-
Notifications
You must be signed in to change notification settings - Fork 687
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
Inconsistent min_gas_price value when in localnet/sandbox #7466
Comments
CC: @jakmeier. Is this something that you can help diagnose please? |
Code in question: nearcore/chain/chain/src/types.rs Lines 172 to 192 in c0706b7
I don't understand why genesis protocol version (as opposed to block's protocol version) would affect this in any way, this requires some git-blame archaeology. |
I don't think the code listed above is relevant. That method seems to only be used to validate that any given block does not exceed limits, which does depend on current limits and genesis limits. The problems seems to be here: nearcore/nearcore/src/config.rs Line 111 in cf71471
For some reason, this value has never been updated. It's also not used at all for mainnet, testnet, betanet or shardnet. Only if the chain id is something else, then the genesis config is generated and actually used. Otherwise this constant seems to be used for tests only. I wonder if the solution is just to update the constant. It seems to break only one test ( |
I think just increasing the constant really is the best way forward. The default gensis config should produce the gas price that is most recent. But I also added comments to make things easier to understand. See PR #7475. I also noticed that shardnet has been launched with the old |
Ah - that explains why some people have seen transactions costing over 30 NEAR .. |
Well, 30 NEAR still sounds like a bit much for a single transaction, if it was only because of the 10x. But I also noticed in the explorer that gas price has been inflated to the max, making it another 20x more expensive. With that, 150Tgas indeed costs 3 NEAR. (But 30 NEAR should still be out of range?) |
Oh, I just noticed that our pessimistic gas price charges go beyond the cap of 20x minimum price. Filed #7477. That explains why users needed more than 30 NEAR to initiate a transaction. |
Describe the bug
On localnet or a sandbox node, gas estimations are 10x the amount. Seems this happening since
min_gas_price
is set to1_000_000_000
instead of100_000_000
which is what is found on mainnet/testnet. From my findings,BlockEconomicsConfig::min_gas_price
determines the min_gas_price dynamically and lowers the min_gas_price to100_000_000
for mainnet/testnet since their genesis protocol version is below a threshold. Meanwhile newly launched localnet or sandbox nodes have protocol version of 56 as of the time of writing this issue which doesn't meet the threshold and causes this inconsistency.To Reproduce
https://github.com/near/workspaces-rs/
phuong/test/proxy
cargo run --example proxy
and then an error should occur like the following:cd nearcore
make sandbox
cd workspaces-rs
NEAR_SANDBOX_BIN_PATH=/abolute/path/to/nearcore/sandbox/debug/neard cargo run --example proxy
where the error no longer occursVersion (please complete the following information):
Additional context
Initial conversation on it in zulip:
https://near.zulipchat.com/#narrow/stream/295558-pagoda.2Fcore/topic/Inconsistent.20min_gas_price.20on.20localnet.2Fsandbox/near/294942074
The text was updated successfully, but these errors were encountered: