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

feat(validator-node): initial state sync implementation (partial) #3826

Merged
merged 5 commits into from
Feb 15, 2022

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Feb 11, 2022

Description

  • add OpLogs
  • add comms RPC methods and client calls to sync validator node state
  • add synchronising state and basic implementation to validator node state machine (currently always in sync due to incorrect Merkle root in initial checkpoint)
  • fix: fetching checkpoint from base node returned incorrect field for asset public key
  • add read only interface for state db

Motivation and Context

Validator node on a committee needs to sync their state after going offline.

How Has This Been Tested?

Manually, it didnt work because the merkle root of the initial checkpoint is incorrect. Sync component has been hardcoded to always say it is in sync for now.

@sdbondi sdbondi force-pushed the vn-state-sync-methods branch 2 times, most recently from 278fcfe to e32070e Compare February 11, 2022 14:36
@sdbondi sdbondi force-pushed the vn-state-sync-methods branch from e32070e to 0a3ddf2 Compare February 14, 2022 07:21
stringhandler
stringhandler previously approved these changes Feb 14, 2022
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice


message StateOpLog {
uint64 height = 1;
string operation = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps an enum here rather?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably, I'm using this "weirdly" as a single char enum - S = Set, D = Delete etc. but an enum is more standard :P

@@ -89,12 +89,12 @@ impl AssetProcessor for ConcreteAssetProcessor {
)
}

fn invoke_read_method<TUnifOfWork: StateDbUnitOfWork>(
fn invoke_read_method<TUnitOfWork: StateDbUnitOfWorkReader>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Perhaps we need a better name, but I like it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a bit long, open to suggestions/change later

@aviator-app aviator-app bot merged commit ee4b52d into tari-project:development Feb 15, 2022
@sdbondi sdbondi deleted the vn-state-sync-methods branch February 15, 2022 09:50
sdbondi added a commit to sdbondi/tari that referenced this pull request Feb 17, 2022
* development: (28 commits)
  fix(wallet): fix aggressive disconnects in wallet connectivity (tari-project#3807)
  chore: honor decimals in ERC20 (tari-project#3809)
  chore: add icons to applications (tari-project#3812)
  fix: daily test (tari-project#3815)
  ci: improvements to macos pkg (tari-project#3824)
  ci: cargo test speedups (tari-project#3843)
  feat: add persistence of transaction cancellation reason to wallet db (tari-project#3842)
  fix: update RFC links and README (tari-project#3675) (tari-project#3839)
  chore: change NodeIdentity debug (tari-project#3817)
  fix(dan): include state_root in node hash (tari-project#3836)
  feat(cli): resize terminal height (tari-project#3838)
  feat(validator-node): initial state sync implementation (partial) (tari-project#3826)
  feat: update console wallet tui (tari-project#3837)
  feat: resize base node terminal on startup (tari-project#3827)
  feat(wallet): add grpc method for setting base node (tari-project#3828)
  chore(deps): bump follow-redirects from 1.14.5 to 1.14.8 in /applications/tari_web_extension_example (tari-project#3832)
  chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 in /applications/tari_collectibles/web-app (tari-project#3833)
  chore(deps): bump follow-redirects from 1.14.5 to 1.14.8 in /applications/tari_web_extension (tari-project#3834)
  chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 in /applications/launchpad/gui-vue (tari-project#3831)
  chore(deps): bump follow-redirects from 1.14.4 to 1.14.8 in /integration_tests (tari-project#3829)
  ...
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.

2 participants