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

Introduce Genesis protocol setting extensions #3168

Merged
merged 4 commits into from
Oct 19, 2023
Merged

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Oct 18, 2023

Close #3156 and extend it to be able to deploy any script in the genesis. Really nice feature, I like it!

TODO:

  • Add a couple of tests
  • Introduce genesis scripts

@AnnaShaleva AnnaShaleva added the enhancement Improving existing functionality label Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #3168 (8cc32a9) into master (04d7786) will decrease coverage by 0.05%.
The diff coverage is 73.02%.

@@            Coverage Diff             @@
##           master    #3168      +/-   ##
==========================================
- Coverage   85.33%   85.29%   -0.05%     
==========================================
  Files         323      326       +3     
  Lines       43641    43773     +132     
==========================================
+ Hits        37242    37335      +93     
- Misses       4932     4965      +33     
- Partials     1467     1473       +6     
Files Coverage Δ
pkg/config/protocol_config.go 90.90% <ø> (ø)
pkg/core/blockchain.go 78.73% <100.00%> (+0.04%) ⬆️
pkg/core/native/contract.go 100.00% <100.00%> (ø)
pkg/core/native/noderoles/role.go 100.00% <100.00%> (ø)
pkg/core/transaction/witness_scope_string.go 85.71% <100.00%> (ø)
...kg/core/transaction/witnessconditiontype_string.go 100.00% <100.00%> (ø)
pkg/network/message_string.go 100.00% <100.00%> (ø)
pkg/core/native/designate.go 81.85% <82.35%> (-0.34%) ⬇️
pkg/crypto/keys/publickey.go 84.18% <76.92%> (-0.40%) ⬇️
pkg/config/hardfork_string.go 55.55% <50.00%> (+5.55%) ⬆️
... and 3 more

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AnnaShaleva AnnaShaleva force-pushed the roles-init branch 2 times, most recently from 0165e2d to fb1b808 Compare October 19, 2023 08:28
And rename roles.go to role.go to match the role_string.go and the
existing naming pattern for enums.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
docs/node-configuration.md Outdated Show resolved Hide resolved
docs/node-configuration.md Outdated Show resolved Hide resolved
pkg/core/native/designate.go Outdated Show resolved Hide resolved
pkg/core/native/designate.go Outdated Show resolved Hide resolved
pkg/crypto/keys/publickey.go Show resolved Hide resolved
@AnnaShaleva
Copy link
Member Author

@roman-khimov, I saw your review and didn't fix it yet, still in progress. Could you, please, review the latest commit? I've just finished it, is it something we'd like to see in our node? If the prototype is OK, then I'll add proper documentation and tests to it.

pkg/core/util.go Outdated Show resolved Hide resolved
pkg/config/genesis_extensions.go Outdated Show resolved Hide resolved
pkg/config/genesis_extensions.go Outdated Show resolved Hide resolved
pkg/core/util.go Outdated Show resolved Hide resolved
pkg/core/util.go Outdated Show resolved Hide resolved
pkg/core/util.go Outdated Show resolved Hide resolved
This section contains genesis-related settings including genesis-related or natives-related
extensions. Currently it includes the set of node roles that may be designated
duing the native Designation contract initialisation.

Close #3156.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Provide a script that should be deployed in the genesis block.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva AnnaShaleva changed the title Introduce GenesisExtensions protocol setting Introduce Genesis protocol setting extensions Oct 19, 2023
@AnnaShaleva AnnaShaleva added this to the v0.103.0 milestone Oct 19, 2023
@AnnaShaleva
Copy link
Member Author

Ready for review.

@roman-khimov roman-khimov merged commit 890f640 into master Oct 19, 2023
13 of 18 checks passed
@roman-khimov roman-khimov deleted the roles-init branch October 19, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add protocol configuration option to setup roles
2 participants