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

Pessimistic Gas Estimation RPC Sandbox Bug #189

Open
BenKurrek opened this issue Aug 15, 2022 · 3 comments
Open

Pessimistic Gas Estimation RPC Sandbox Bug #189

BenKurrek opened this issue Aug 15, 2022 · 3 comments
Labels

Comments

@BenKurrek
Copy link

I think I may have found an issue with the sandbox RPC gas estimation. It's consistently off by a factor of 10x. The RPC is calculating that a transaction costs 100x more than it should on Testnet. For example, a transaction costing 100 TGas on Testnet requires an allowance of at least 0.018742435949557556914715 but when replicating the same behaviour with workspaces sandbox, the number is 0.18742435949557556914715 which is 10x higher. In both scenarios, the GAS being attached to the txn is 100 TGas.

Steps to reproduce:

@volovyks volovyks added the P1 label Aug 15, 2022
@BenKurrek
Copy link
Author

Hey are there any updates on this? It's a pretty major blocker for NEARCon POAPS testing.

@BenKurrek
Copy link
Author

I did some digging and ended up finding the root cause. When I go to my temp folder and view the sandbox information for tests, the genesis.json file is exposed. Within that file, there's a min_gas_price set to 1000000000. This value is 10x

higher than the Gas price for testnet and mainnet that can be queried for. For example, if you run the following HTTP req, it will return a gas_price of 100000000

{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "gas_price",
  "params": [null]
}

Returns:

{
    "jsonrpc": "2.0",
    "result": {
        "gas_price": "100000000"
    },
    "id": "dontcare"
}

When comparing this value with the value in genesis.json:
Genesis:
1000000000
Testnet
100000000

@ChaoticTempest
Copy link
Member

ChaoticTempest commented Aug 22, 2022

I don't think the min gas price is why since for a sanity check, I migrated this test up to the failure point over on workspaces-rs (https://github.com/near/workspaces-rs/tree/phuong/test/proxy) and it doesn't error out when you go to run it with cargo run --example proxy. Could be some improper config on workspaces-js, since IIRC, @volovyks said there were some inconsistencies between sandbox and testnet for workspaces-js

So after talking with @BenKurrek, the error is further down in claim and feels like a sandbox bug more than anything, where the genesis file doesn't reflect what's on testnet/mainnet. Will dig further to see what's going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants