Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevOps: merge master into feature/alphanet #5203

Conversation

onetechnical
Copy link
Contributor

@onetechnical onetechnical commented Mar 14, 2023

Merge 389b8ac

Aharonee and others added 30 commits October 23, 2022 15:20
* [WIP] Migrate stateproof database to store builders and add PersistentBuilder type

* [WIP] Refactor builder and remove PersistentBuilder and dependency on VotersForRound

* [WIP] Add persistBuilders flag to stateproof.Worker, and delete old builders from database

* [WIP] .

* Finalize the builder struct, fix deleteOldBuilders and make msgpack

* Finalize implementation and fix tests

* Add and update unit tests to verify database is consistent with builders in memory

* rename stateproof top voters alloc bound name

* fx: removed comment

* refactor: fetchBuilder to treat errors from decoding.

* using sql.ErrNoRows

* rm: unused fields in stateproof/Worker

* fx: avoiding sql access for sigs in the future

* refactor: moving persisted fields into BuilderPersistingFields struct

* fx: stating that the worker is not a persistentBuilder in numerous unit-tests

* inspect sig is in db prior to signing in func signStateProof

* improved exists claus

* reviewdog-fix

* refactor: getBuilder func to not fill a ptr

* fx: fetchBuilderForRound behaviour

* fix: shutdown to worker after db-init in test

* fx: warning instead of error log

* rm: error var

* fx: separate SP DB schema upgrade into two functions

* adding unit test for db schema upgrade

* rm: close db inside makeStateProofDB

* improved unit-test

* renamed b as var name

* fx: comment

* fix: unneeded if statement in the sigExistsInDB

* fix: small bug in sigExistsInDv verify

* adding unit-test to ensure fetching from disk is performed

* adding unit-tests

* adding unit-test that catchs an issue

* fx: when fetching builder from DB - fill with sigs

* fx: fetchBuilderFromDB refactor

* fx:race

* reusing code

* fx: race

* fx: watch-dog issue

* fx: comment

* rename insertBuilder func

* improvement: reloading sigs-per-round

* removing unneeded field from func fillBuilder

* fix CR

* fixing edge cases with when no signatures are in the database

* support old databases having only signatures

* fix bug + work on tests

* adjusting tests

* close the query

* verify that builder can be loaded with no signatures

* remove the const flag for now

* fmt

Co-authored-by: Jonathan Weiss <jonathan.weiss@algorand.com>
Co-authored-by: algoidan <idan@algorand.com>
…nd#4570)

* added state proof verification tracker skeleton

* now saving data regarding state proofs on new block

* added test for state proof verification tracker

* Removed comments from interface functions

* added sp verification tracker to the ledger

* added license, returning the appropriate value from produceCommittingTask

* now handling 0 in StateProofInterval

* tracker test now test removal from tracker

* removal now works

* added db version and created sp verification table

* moved verification data type to ledgercode and generated encode functions

* added state proof round to verification data for db indexing

* added code to prune old state proofs

* added code to retrieve verification data from the tracker

* commented out some code, now also saving generated round in verification data

* now testing addition and committing

* import order fix

* now using deltas to decide whether a state proof has occurred in a block

* basic addition and removal work and are tested

* some test refactoring

* added test for chain in happy flow

* renamed and refactored a lot of code

* fixed emergent index usage bug

* added test with disabled state proofs

* changed variable usage for more readable code

* changed error reporting in tracker lookup

* changed lookup, added more commit tests

* increased confidence in produceCommittingTask

* added db pruning tests

* reordered tests, finished pruning tests

* handled initialization slice size

* fixed v6 migration test to not impact global state

* added state proof verification table creation to TestLedgerReloadTxTailHistoryAccess

* added missing table in ledger test

* all tests except interval change work

* fixed bug in receiving deletion data, added test for interval change

* changed tracker and refactored tests to not touch the dcr

* generated round no longer saved in db

* renamed delete data, split newBlock to functions

* reordered functions, now locking to protect internal data structures

* some lock reordering

* added necessary comment for compilation

* added comments where relevant

* closed todos in ledger

* some renaming

* fixed bug in deletion index check

* added tracker ledger test

* removed todo that is now a ticket

* wrapped verification data insert with db.retry

* added nil check on close

* updated dump_genesis.sh

* added lookup tests

* removed redundant passing of slice by reference

* CR: now testing data len to return

* CR: Renamed ProvenWeight to OnlineTotalWeight

* CR: separated imports

* CR: avoiding looking into future protocols in loadfromdisk

* CR: Now breaking to avoid redundant comparisons in an already sorted array

* CR: Removed redundant optimization from test.

* CR: added checks to verify that new blocks indeed arrive in order

* now panicking after logging invalid new block

* CR: No longer passing entire data structure where round would suffice

* removed usage of proto in loadfromdisk

* CR: now wrapping errors in lookup

* some lookup refactor

* improved error message

* missing parantheses

* error check fix

* CR: some refactors around verification data lookup

* CR: removed accountdb prefix from creation function

* CR: error refactoring

* ledger test now asserts more specific situations

* CR: added unit test for panic

* CR: moved locking for performance improvement

* CR: added load from disk test

* CR: moved reload test to ledger_tests

* CR: Removed redundant error check
* fix: stateprf deletes keys after stateproof advances.

* fixed unit test to match the current code of key deletion

* fix: all unit tests pass, added TODO

* fx: comment

* fx: deletion of previous rounds

* fx: unit-test

* fx: prevStateproof init value

* fx: golangcli

* fix merge issues.

* refactoring

* add test

* fix deletion bug

* fix tests

* refactoring tests

* reuse code on tests

* fix keys removal to use the next state proof

* builder will not remove signatures and builder to support recoverability

* refactoring + avoid remove if stateproof was not changed

* remove double test

* checking that the deletion round is not higher than expected

* minor refactor

* we now remove the last ephemeral key

* nits

* add test for deleting all keys in account manger

* move warning message to error

Co-authored-by: algoidan <idan@algorand.com>
* add version to the verification structure and new consensus param

* refactor state proof verifcaion

* apply state proof using trakcer

* export stateproof verification data in LedgerForCowBase interface

* using tracker on tests.

* fix ledger test

* fix borken interface

* choose to use the tracker based on atRound proto version

* fix tests

* testing v34

* refactoring

* fix comments
* adding one memory slot for latest sp-verification-data

* refactor: changed if-else to one if clause

* loadFromDisk should fill lastSeenStateProofVerificationData from the disk

* added unit tests

* fix: caching latt lookup for future uses

* sql-fx

* fix: returning copy of the lastLookedUpVerificationData

* fix: checks cache location moved
removed unneeded sql lookup on reload from disk
fixed comments
fix: zero-cache is ignored

* removed comment from function
icorderi and others added 24 commits March 7, 2023 14:46
Co-authored-by: algochoi <86622919+algochoi@users.noreply.github.com>
@onetechnical onetechnical self-assigned this Mar 14, 2023
@onetechnical onetechnical changed the base branch from master to feature/alphanet March 14, 2023 15:11
@onetechnical
Copy link
Contributor Author

Dupe #5202

@onetechnical onetechnical deleted the alphanet-master-merge-389b8ac99 branch March 14, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet