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

Testnet 23 #3903

Merged
merged 155 commits into from
Jun 2, 2023
Merged

Testnet 23 #3903

merged 155 commits into from
Jun 2, 2023

Conversation

AurelienFT
Copy link
Member

No description provided.

Eitu33 and others added 19 commits May 30, 2023 13:29
Co-authored-by: sydhds <sd@massa.net>
* Optim: If we need to interpolate a lot of cycles, only build the last ones

* TEST RocksDB checkpoints

* Added logs for ledger backups and recovery (check hash)

* Moved the LedgerBatch to final_state, step 1

This does not build, I have to add the logic of apply_change to the given ledger_batch

* Pass around a handle to the RocksDB DB instead of creating multiple ones

* Resolve deadlock in bootstrap test

* Changed AyncPool methods, bootstrap fails

* Fixed bug in bootstrap test.

* Resolved serializing issue with AsyncMessage in DB

* fixed doc test

* Big commit, see details inside desc

- Created massa-db package for easier access to rocks_db in final_state
- Put the AsyncPool in rocks_db
- Re-designed the speculative async_pool to avoid querying rocks_db too much

/!\ Tests fail! Need to investigate
But now the execution tests are not in a deadlock state.

* Added mini cache to async_pool, and used SetUpdateOrDelete

* Update mini cache + doctest passes

* Fix after merge

* Boilerplate for new rocks_db in final_state

* RocksDB for executed_ops and denunciations

* Fmt + Clippy fix

* Updated Pool message iterating

* Handle the async_pool iteration differently

Iteration per message > Iteration per key

* Fixed after merge

* Cleaned some things + docs

* Recompute all caches on init of final_state

* Additionnal cleaning (e.g. unused function)

* Added unit test for rocksdb final_state

* Add bool to reset the final_state on init

* Fix test

* Added back the test_take_batch for async_pool

* fmt fix

* Fix merge

* Big commit, see description

Put Final_state in a single column family.

TODO: Handle bootstrap as a single step and prefixes (e.g. LedgerPrefix !)

* clippy + fmt

* Unified bootstrap of final_state

* Put pos_state in rocks_db

* Fixed prefix_iteration problem

* another pass at iterator problems

* Added last_slot_before_downtime in final_state

* Fixed iteration error in pool cache reconstruction

* Fixed deferred_credits and production_stats behaviour

Still bootstrap test ignore

* fmt after merge

* Cleaned before working on bootstrap changes

* Wrapped the rocksDB structure

Needs several edits to existing code (e.g. bootstrap, write_batch)

* Almost everything up to date

Boostrap test still fails, have to debug with more logs!

* Fixed some of the bootstrap bugs

/!\ Some Deadlocks are a problem
/!\ Several TODOs in the code (commented ou asserts...)

* Started implementing Monotree

* Spring cleaning (DBBatch type)

* Fix cargo.lock after merge

* Fixed deadlock in pos_state

* clippy fixes

* Fixed pos_state change fail in bootstrap test

Also removed println!

* Fixed monotree

But Hash computations do not sync right on write_batch

* Added checks to bootstraped db (is_db_valid())

* Fix after merge w/ testnet23

* changed monotree dep

* Implemented XOR, test passes with it

* Removed old todo comment

* Added network restart documentation in massa-final-state crate lib.rs

* tmp

Signed-off-by: Litchi Pi <litchi.pi@proton.me>

* fixup

Signed-off-by: Litchi Pi <litchi.pi@proton.me>

* assert it's not the initial bytes

Signed-off-by: Litchi Pi <litchi.pi@proton.me>

* Removed create_initial_cycle from new_derived_from_snapshot

* Various fixes

- Fix cargo.lock after massa-sc-runtime update
- Don't create_initial_cycle if restarting from snapshot
- Cargo fixes

* fmt fix

* Cleaned error handling

* Cleaned unused tests, added comments

* Fixed consensus mock in bootstrap test

* Fixed after merge

* Cleanup warnings + monotree, clear the current_hashmap in db

* Fix bootstrap_test after last commit

* Additional cleaning following self review

Still need to review:
- Bootstrap server
- Final_state and massa_db
- Read and writes to the DB in all sub-structures of final_state

* Added a TODO comment

* Updated ledger_db to use MassaDB helper functions directly

* Added comments

* Fix tests after merge

* Finished self review, added TODO_PR comments for everything to fix before merge.

* Fixed bad behaviour of bootstrap streaming of stream_batch

* Added doc_comments for massa_db

Also only put the cur_change_id in the db to avoid desync

* Fixed bad final_state_test

* Import lsmtree instead of new

* removed final_state_hash

* Removed slot in final_state

* Removed initial_ledger_hash

* recompute caches no longer duplicated.

* Changed pos apply change documentation

* Cleaning of un-necessary recomputes

* Fix slot in bootstrap

* Fixed weird behaviour for bootstrap

* Try fix bootstrap

* Fix in deadlock in downtime interpolation

* fmt fix

* Fix: only backup on a slot with thread == 0

* Fix slots logic and interpolation

* fmt fix

* fix tests after slot behaviour change in final_state

* Removed println in final_state is_db_valid

* Updated bootstrap deserializer args for state_length

* Update op_exec_status on pruned executed_ops

* Updated pos_state test, remove roll_counts at 0

* Fix after merge

* typo fix

* removed create_snapshot (unused) feature

* revert node log level (from 3 to 2)

* Use format!() to construct backup directory

* Clean batch allocation in massa_db

* Used assert_eq!() instead of panic!() in finalize

* Use unreachable!() instead of todo!() in massa-hash

* Added debug_assert_eq!() to check Hash size and LsmTree output_size match

* Commit review suggestion

Co-authored-by: Litchi Pi (Tim) <litchi.pi@proton.me>

* Cargo fmt fix

* Updated state_step inconsistant error messages

* Updated XOR hash comment

* Add mip_store in final_state (#3992)

* Add mip_store in final_state

* Add reset_db in MIP store

* Fix bootstrap test - added the case of empty Versioning bootstrap

We have to rethink of how the cursors work, see follow up issue #4000

* Rework shutdown start & shutdown end computation for final state check

* Rework delete_prefix

* Rework extend_from_db for MipStore

---------

Co-authored-by: sydhds <sd@massa.net>
Co-authored-by: Leo-Besancon <leoleo38@live.fr>

* Fix after merge

* Fix after merge

* Improve error message if update_batches call fail

* Fix lsmtree version in massa_db

* Update MAX_BOOTSTRAPPED_NEW_ELEMENTS to 500

---------

Signed-off-by: Litchi Pi <litchi.pi@proton.me>
Co-authored-by: Litchi Pi <litchi.pi@proton.me>
Co-authored-by: Sydhds <sylvain.delhomme@gmail.com>
Co-authored-by: sydhds <sd@massa.net>
* Save block for the whole cycle without ops

* Clippy fix.

* Fix clippy

* remove debug print

* Fix conditions
#4008)

* Use saturating_add/sub when updating mip store stats + update versioning documentation

* Restore debug print

* Move MIP info declaration in its own file

---------

Co-authored-by: sydhds <sydhds@gmail.com>
* Use keypair version to generate secret key in massa client

* Add doc for MipComponent grpc struct

---------

Co-authored-by: sydhds <sydhds@gmail.com>
* Initial commit

* Cargo fmt fix

* Update timestamps
* Initial commit

* Used time instead

* Implemented helper functions in massa-time

* Fixed doctest
@AurelienFT AurelienFT marked this pull request as ready for review June 2, 2023 13:23
Leo-Besancon
Leo-Besancon previously approved these changes Jun 2, 2023
* Remove FactoryStrategy::Latest variant

* Fix address creation in SC (cherry pick from PR #4027 by damip)

---------

Co-authored-by: sydhds <sydhds@gmail.com>
@AurelienFT
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 2, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 42ff16c into main Jun 2, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants