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

[Governance] Musical Chairs #1235

Closed

Conversation

0o-de-lally
Copy link
Collaborator

@0o-de-lally 0o-de-lally commented Feb 10, 2023

Features

  • Evaluate nodes that are compliant, and get ratio of non compliant
  • Calculate the expansion, or reduction of the set based on heuristic
  • EpochBoundary uses next validator set size, to finalize auction (proof of fee)

Testing

  • init from genesis
  • epoch boundary
  • eval compliance
  • return new size per thresholds

…session from fake data to be able to apply migrations from Move system contracts.
implement functional tests for:
- exporting db backup to json
- creating genesis blob from json
- creating genesis blob in one shot from db backup

TODO: launch test node from from genesis.blob
TODO: e2e tests from a fixture file
@0o-de-lally 0o-de-lally marked this pull request as ready for review February 17, 2023 03:19
@0o-de-lally
Copy link
Collaborator Author

@hemulin The relevant files are in diem-move/diem-framework/DPN/sources/0L/
Note that many of those changes commits included in ProofOfFee

Perhaps start focus on:
https://github.com/0LNetworkCommunity/libra/pull/1235/files#diff-453224ca439c5b539a6049522f5bcae54cb0db903170654f0b777b2971fd5da0

0o-de-lally and others added 3 commits April 5, 2023 15:41
* For 0L genesis tools for hard forks, and migrations: create a MoveVm session from fake data to be able to apply migrations from Move system contracts.

* wip testing fakeexector for account migrations

* Scaffolding tests for v6 genesis fork. first cleanup deprecated modules.

* add fixtures for testing recovery genesis

* cleanup fixtures
implement functional tests for:
- exporting db backup to json
- creating genesis blob from json
- creating genesis blob in one shot from db backup

TODO: launch test node from from genesis.blob
TODO: e2e tests from a fixture file

* integration test using blob from fixture to start a diem-node in test mode

* patch github actions tests

* full e2e test from db backup to starting a node

* Add diem_logger as per @corythian plus comments.

* query nodes to check if onchain state is the same as recovery.

* - include db reader util to inspect a genesis.blob.
- refactor recovery tests

* test to check validator count. cleanup test utlis

* cleanup tests

* stub a "check" feature, to check a json file agains the output genesis.blob

* finish balance comparison with error list.

* clean

* test to create single validator and check output.

* skip comparing system zero address.

* cargo fix

* cargo fmt

* create function to start a vm executor, and uses a function pointer to transform legacy data to Move arguments.

* experimenting with alternative way of starting a vm genesis session

* runs

* cleanup

* need to explicitly set the validators at genesis

* test to confirm genesis validator set, is the same as defined set.

* tests for validator set and balance passing

* change fixtures, make node start from command line

* can start a test node from genesis blob

* can genesis tools test can start a node from a genesis and query for an accounts resources

* make ol version of swarm config generator in ol/smoke_tests

* wip

* move legacyRecovery to ol/types. So now we can run the user migrations in the vm_genesis::lib. First draft builds

* create GenesisMigration user migration test. Builds.

* ol/genesis-tools builds with refactor

* refactored with clean build

* minor refactors

* can migrate the balance of end users with new design

* migration successfully migrates balances of users, validators, and operators.

* cleanup unused files. clippy,

* tests passing

* PoF requires all nodes to have equal weight in consensus per the paper.

* Update ci.yaml (0LNetworkCommunity#1239)

* [Genesis] Migration tools for genesis from legacy accounts (0LNetworkCommunity#1237)

* For 0L genesis tools for hard forks, and migrations: create a MoveVm session from fake data to be able to apply migrations from Move system contracts.

* wip testing fakeexector for account migrations

* Scaffolding tests for v6 genesis fork. first cleanup deprecated modules.

* add fixtures for testing recovery genesis

* cleanup fixtures
implement functional tests for:
- exporting db backup to json
- creating genesis blob from json
- creating genesis blob in one shot from db backup

TODO: launch test node from from genesis.blob
TODO: e2e tests from a fixture file

* integration test using blob from fixture to start a diem-node in test mode

* patch github actions tests

* full e2e test from db backup to starting a node

* Add diem_logger as per @corythian plus comments.

* query nodes to check if onchain state is the same as recovery.

* - include db reader util to inspect a genesis.blob.
- refactor recovery tests

* test to check validator count. cleanup test utlis

* cleanup tests

* stub a "check" feature, to check a json file agains the output genesis.blob

* finish balance comparison with error list.

* clean

* test to create single validator and check output.

* skip comparing system zero address.

* cargo fix

* cargo fmt

* create function to start a vm executor, and uses a function pointer to transform legacy data to Move arguments.

* experimenting with alternative way of starting a vm genesis session

* runs

* cleanup

* need to explicitly set the validators at genesis

* test to confirm genesis validator set, is the same as defined set.

* tests for validator set and balance passing

* change fixtures, make node start from command line

* can start a test node from genesis blob

* can genesis tools test can start a node from a genesis and query for an accounts resources

* make ol version of swarm config generator in ol/smoke_tests

* wip

* move legacyRecovery to ol/types. So now we can run the user migrations in the vm_genesis::lib. First draft builds

* create GenesisMigration user migration test. Builds.

* ol/genesis-tools builds with refactor

* refactored with clean build

* minor refactors

* can migrate the balance of end users with new design

* migration successfully migrates balances of users, validators, and operators.

* cleanup unused files. clippy,

* tests passing

* whitespace to trigger ci

* initial scaffold of proof-of-fee auction. Borrows code from NodeWeight. Includes tranaction api.

* implement seat filling algo, which considers the 1/3 unproven node limit on epoch changes

* patch

* patch

* builds

* implement vm function to pay fee from user account

* all validators are charged fee at epoch boundary

* cleanup  validator set proposal functions

* refactor jail function at epoch boundary

* make epoch boundry _meta_epoch.move pass

* filter for vouches on proof of fee

* initialize val account with a PoF struct

* epoch reconfiguration meta tests passing. PoF bid initialization unit tests passing. Validator meta sanity tests passing

* patch issue with failover

* add bid restrictions, and checking upon seating

* burn excess fees than needed for validators

* reward thermostat initial implementation

* genesis init fee baseline

* patch bug in thermostat

* more tests for fill_seats, and thermostat. patches

* test

* consolidate validator audits, check for the case that there are fewer bidders than the stated val set.

* add test fixtures, modify some APIs "tell don't ask" pattern. Add several tests.

* add unit tests for thermostat. Patch a couple bugs

* tests for thermostat increase/decrease

* deprecate Audit.move, and create tests for qualifications in Proofoffee.move

* Jailing mechanism needs update after deprecating Towers. Proposing here that a Voucher is the only one to unjail, since there is no other practical hurdle.

* audit tests for vouch, expired bids, no_funds

* covered all proof of fee functions, tests for all common scenarios of fill_seats, patch logic issues, all proof of fee tests passing!

* patch seating failover

* Clean up Cases.move. Patch Vouch tests fixtures

* adjust fixtures for reconfiguration tests, deprecate some tests, patch jailing

* patch all reconfig test fixtures. remove deprecated burn tests.

* continue patching tests and removing deprecated scenarios

* All transactional tests passing!

* txs transaction apis for setting and retracting bids.

* test for set and retract

* cleanup prints

* add struct in TransactionFee to track origin of fees FeeMaker

* refactor Burn to consider the preference of the user FeeMaker

* cleanup

* init FeeMaker on account creation

* patch tests to remove `print`

* patch epoch boundary burn ratios

* all tests passing

---------

Co-authored-by: Zoz <97761083+0xzoz@users.noreply.github.com>
@0xzoz
Copy link
Collaborator

0xzoz commented Jul 5, 2023

Closing due to changes included #1261

@0xzoz 0xzoz closed this Jul 5, 2023
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

2 participants