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(amend-genesis): allow setting the gas price #10389

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

marcelo-gonzalez
Copy link
Contributor

After near/NEPs#92, the min gas price was set to 100M yoctoNEAR. But the genesis file we get from the state viewer dump-state command copies the 1B min gas price from the genesis file. This results in a network with 10x the gas fees as mainnet when we launch mocknet testing networks, and many transactions sent by the mirror run command fail with too little balance. So this PR allows setting the min/max gas prices in the mocknet genesis file so we can fix that. It might also be worth changing the behavior of view-state dump-state to set the min gas price, but this will work for now and lets us get the right gas price in all cases

After near/NEPs#92, the min gas price was
set to 100M yoctoNEAR. But the genesis file we get from the state viewer
dump-state command copies the 1B min gas price from the genesis file. This
results in a network with 10x the gas fees as mainnet when we launch mocknet
testing networks, and many transactions sent by the mirror run command fail
with too little balance. So this PR allows setting the min/max gas prices
in the mocknet genesis file so we can fix that. It might also be worth
changing the behavior of `view-state dump-state` to set the min gas price,
but this will work for now and lets us get the right gas price in all cases
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (02c725c) 72.01% compared to head (080a797) 72.00%.

Files Patch % Lines
tools/amend-genesis/src/lib.rs 0.00% 2 Missing and 4 partials ⚠️
tools/amend-genesis/src/cli.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10389      +/-   ##
==========================================
- Coverage   72.01%   72.00%   -0.01%     
==========================================
  Files         718      718              
  Lines      144524   144532       +8     
  Branches   144524   144532       +8     
==========================================
- Hits       104072   104066       -6     
- Misses      35703    35711       +8     
- Partials     4749     4755       +6     
Flag Coverage Δ
backward-compatibility 0.08% <0.00%> (-0.01%) ⬇️
db-migration 0.08% <0.00%> (-0.01%) ⬇️
genesis-check 1.26% <0.00%> (-0.01%) ⬇️
integration-tests 36.73% <0.00%> (-0.04%) ⬇️
linux 71.55% <0.00%> (-0.02%) ⬇️
linux-nightly 71.58% <0.00%> (-0.01%) ⬇️
macos 53.79% <0.00%> (-0.01%) ⬇️
pytests 1.48% <0.00%> (-0.01%) ⬇️
sanity-checks 1.27% <0.00%> (-0.01%) ⬇️
unittests 68.22% <0.00%> (-0.01%) ⬇️
upgradability 0.13% <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.

Copy link
Contributor

@VanBarbascu VanBarbascu left a comment

Choose a reason for hiding this comment

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

Looks good!
If I want to use the tool, how would I know what values to use for the newly added parameters?

@marcelo-gonzalez
Copy link
Contributor Author

Looks good! If I want to use the tool, how would I know what values to use for the newly added parameters?

Really you can choose whatever you want to test with, but for these mocknet tests I'm going to set the value of 100000000 because that's the current value on mainnet, but the mainnet genesis has a value of 1000000000, which is too big

@marcelo-gonzalez marcelo-gonzalez added this pull request to the merge queue Jan 8, 2024
Merged via the queue into near:master with commit aa45cec Jan 8, 2024
22 checks passed
@marcelo-gonzalez marcelo-gonzalez deleted the gas-price branch January 8, 2024 17:46
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