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(fork-network): use the epoch config files to setup the nodes #12420

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

VanBarbascu
Copy link
Contributor

@VanBarbascu VanBarbascu commented Nov 8, 2024

When setting up a forknet, the neard fork-network set-validators command is run after neard init. If init was executed with --dump-epoch-config, the epoch_configs directory is populated with the mainnet epoch configs.

Additionally, the mirror tool now includes an option to provide overrides to the epoch configurations.

For further details, check this PR (#12421).

If epoch config files are present, they will be utilized to create the genesis configuration for the fork network.

tools/fork-network/src/cli.rs Outdated Show resolved Hide resolved
near_config.genesis.config.protocol_version = genesis_protocol_version;

// This is based on the assumption that epoch length is part of genesis config and not epoch config.
near_config.genesis.config.epoch_length = epoch_length;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also assert that genesis and epoch config have the same lengths? is it possible that they are different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, the epoch_length, comes from the cli parameter passed by neard-runner.
If we dump the epcoh config files on init, the epoch config will have epoch_length=43200 (the value from mainnet)
The epoch_length is a special case of epoch_config. Given that a lot of tests instrument the epoch_length from genesis, we decided to keep genesis as the source of truth for the epoch length.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 71.46%. Comparing base (dc0e1e9) to head (4e95621).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
tools/fork-network/src/cli.rs 0.00% 35 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12420      +/-   ##
==========================================
- Coverage   71.47%   71.46%   -0.02%     
==========================================
  Files         837      837              
  Lines      169348   169370      +22     
  Branches   169348   169370      +22     
==========================================
- Hits       121043   121038       -5     
- Misses      42962    42983      +21     
- Partials     5343     5349       +6     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.28% <0.00%> (-0.01%) ⬇️
integration-tests 39.34% <0.00%> (-0.02%) ⬇️
linux 70.77% <0.00%> (-0.01%) ⬇️
linux-nightly 71.03% <0.00%> (-0.01%) ⬇️
macos 51.07% <0.00%> (+0.01%) ⬆️
pytests 1.59% <0.00%> (-0.01%) ⬇️
sanity-checks 1.40% <0.00%> (-0.01%) ⬇️
unittests 64.02% <0.00%> (-0.01%) ⬇️
upgradability 0.21% <0.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.

@VanBarbascu VanBarbascu added this pull request to the merge queue Nov 13, 2024
Merged via the queue into near:master with commit f4e9dd5 Nov 13, 2024
29 checks passed
@VanBarbascu VanBarbascu deleted the forknet/epoch_config branch November 13, 2024 15:56
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