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: align on-chain valset with genesis.json valset #2465

Closed
wants to merge 49 commits into from

Conversation

zivkovicmilos
Copy link
Member

Description

Depends on #2130

This PR introduces an alignment between the genesis.json validator set (lives on-disk), and the on-chain validator set in the genesis transactions.

How it works:

  • Regardless of what valset management protocol we choose (PoC / PoS / PoA), the initial chain state will always be aligned with whatever is in the genesis.json valset
  • The protocol to use is a configuration param (config.toml), and it's none by default (current behavior). The reasoning behind keeping it in the node's config.toml is to ensure this value is accessible from different stages of the chain pipeline (from genesis.json generation -> EndBlocker)
  • If the user wants to use Proof of Contribution, they need to predeploy the r/sys/vals Realm (the deployment transaction must be present in the genesis.json) before starting their chain
  • Whenever the user adds or removes a new validator from the genesis.json, the r/sys/vals Realm deployment transaction is updated to reflect the current state in the genesis.json
    • Only the init (constructor) part of the r/sys/vals Realm is updated, to reflect the changes. We use Go's templates for this purpose as it's a simple paste

cc @gfanton @moul

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@zivkovicmilos zivkovicmilos added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jun 30, 2024
@zivkovicmilos zivkovicmilos self-assigned this Jun 30, 2024
@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 🤖 gnovm Issues or PRs gnovm related 📦 🌐 tendermint v2 Issues or PRs tm2 related labels Jun 30, 2024
@zivkovicmilos zivkovicmilos changed the title feat: align genesis.json valset with on-chain valset feat: align on-chain valset with genesis.json valset Jun 30, 2024
Copy link

codecov bot commented Jun 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.71%. Comparing base (10a6f7e) to head (41cbb2e).
Report is 183 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2465   +/-   ##
=======================================
  Coverage   54.71%   54.71%           
=======================================
  Files         583      583           
  Lines       78499    78499           
=======================================
+ Hits        42947    42953    +6     
+ Misses      32344    32340    -4     
+ Partials     3208     3206    -2     
Flag Coverage Δ
contribs/gnodev 23.81% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gnovm 59.98% <ø> (ø)
tm2 54.44% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zivkovicmilos
Copy link
Member Author

Closing this PR after discussing with @moul a while back -- we are fine with genesis coordination being manual for now, and we will utilize other mechanisms for this sort of thing in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant