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

deferred credits #3740

Closed
wants to merge 2 commits into from
Closed

deferred credits #3740

wants to merge 2 commits into from

Conversation

damip
Copy link
Member

@damip damip commented Mar 30, 2023

Example for @Leo-Besancon

DO NOT MERGE AS IS

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

@damip damip added the blocked Issues that can't be done for now. label Mar 30, 2023
@Leo-Besancon Leo-Besancon mentioned this pull request Mar 31, 2023
7 tasks
Leo-Besancon added a commit that referenced this pull request Mar 31, 2023
@Leo-Besancon
Copy link
Collaborator

Leo-Besancon commented Apr 4, 2023

Used in commit 1f77ece, and included in PR #3624. We can close this PR now. Thank you for your inputs!

Leo-Besancon added a commit that referenced this pull request Apr 4, 2023
* Initial commit for network restart: Archive read / write

Needs testing

* Skeleton of the snapshot creation workflow

* Removed archiving tests

* fmt

* cleaned a bit the FinalState init

* Cleaned (check / clippy)

* Added Pos deserialization

* Added final state serialization to file

* Refactoring + create final_state dir if it does not exist

* fixed path issue

* Reverted some commits of local config

* Don't reset ledger if from snapshot (will be changed for testnet21)

Indeed, we will always keep the ledger from now on.

* Compute and check hash of recovered final_state

* Don't replace old ledger

* Changed timestamps to account for LAST_START_PERIOD

But no finalized blocks are made anymore, I'll have to check the concensus rules...

* fmt

* Fixed some final_cursor issues

create_snapshot and --from_snapshot should work well in sandbox mode!

* clippy allow lint in case the constant is not 0

* Changed LAST_START_PERIOD from const to static ref

+ Ledger rollback based on genesis_timestamp

* Fixed cycle_history issue and block_header deserialize assumption

* fmt

* Fixed hash computation in --from_snapshot

* cleaned the code

* Rethought the cycle logic when LAST_STAR_PERIOD is not 0.

* Keep previous roll_counts

* fmt

* clippy

* Fixed initial_rolls when snapshotting

* Added feed_cycle_state_hash in --from_snapshot

Don't know if I should do it or not :/

* fmt

* Set up PoS_final_state after bootstrap

* fmt

* Added debug info

* Fix Mutex lock issue

* change config for tests

* Added bootstrap of initial pos_state info

- initial_cycle
- initial_rolls
- initial_ledger_hash

* Change desynchronisation checks

* Added cycle_history debug info

* Boostrapable last_start_period value

* Final_state in ledger

* Fixed final state in ledger

The dump / commit logic is probably false right now, need to investigate the best way to handle it

* doctest pass

* Fix bootstrap message deser

* disable desync detection + bootstrap fix

* Fixed deployment (lazy_static parsing fail) + fmt

* logs for cycle info changes

* Fixed execution cycle lookback

* Tried to fix the draws

* Updated deferred credit logic

* Fixed deferred credit hash for snapshot + removed info!()

* Make test pass + clean info!() logs

* Removed final_state_path setting, no longer used

* Added documentation, restored periods_per_cycle at 128

* Refactoring + Only bootstrap the initial_state once

* Update massa-final-state/src/final_state.rs

Co-authored-by: Ben <benphawke@gmail.com>

* fmt

* Cleaned the FinalState::from_snapshot() method

Created Ser/Deser helpers for FinalStateRaw.

* Better handle final_state in RocksDB

* Added a TODO for get_pinned

* Use range() on the BTreeMap to better filter the slot range.

* Fixed a regretion in the previous commit

* Doc comments lints

* Doc comment for final_state_data in ledger

* cleaned final_state_raw_deserializer args

* Used get_pinned_cf for final_state_hash

* fmt + _args => args

* Changed final_state dispatch in main

* Interpolate the cycles (untested)

* Small fixes and lints

* Delete intiial_state logic (bootstrap, deser, ...) + iniitial_cycle for pos_state

* fmt

* clippy fix

* update snapshot logic without get_final_state

* Set period_per_cycle to 10 for tests

* Fix feed_cycle_hash

* fmt

* Feed selector during downtime interpolation

* feed_selector and compute draws logic added

* clippy fix

* Don't dump the final_state on finalize()

* Added comments for periods_per_cycle

* small refactoring and docs update for pos_final_state

* Make CI pass

Cf #3742

* Small refactor of final_state

* Add TODO for commented imports

* Refactor final_state downtime interpolation

* Removed an unneeded rocks_db call

* Included (x-1) > Excluded (x) in bounds

* fmt

* Updated deferred_credits logic, TODO: TESTS

Inspired from #3740

* Small cleanup / renames

* Updated roll_sell test to test the new deferred_credits impl

* Cleanup after changes: no more last_start_period needed in pos_final_state

* TODO: CHANGE BACK CONST

* Fixed block_factory next_slot if before last_start_period

* Update final_state.rs

* Changed rng_seed push to avoid loops

* info > debug for all denuncuations

* Revert "info > debug for all denuncuations"

This reverts commit 2b28b33.

* Make PR Ready!

* Fix merge with GRPC

* Improved some docs

* Fix execution test after merge

* New pass over documentation

* Final doc improvements

* Apply suggestions from code review

Co-authored-by: Ben <benphawke@gmail.com>

* Applied most of the suggestions in review

* fmt

* fixed stats feature flags

* fmt

---------

Co-authored-by: Ben <benphawke@gmail.com>
@damip damip changed the title deferrede credits deferred credits Apr 5, 2023
@AurelienFT AurelienFT deleted the damir_deferred_creds branch May 29, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issues that can't be done for now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants