Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Non deterministic gas estimation test #536

Closed
fedekunze opened this issue Sep 7, 2021 · 3 comments · Fixed by #890
Closed

Non deterministic gas estimation test #536

fedekunze opened this issue Sep 7, 2021 · 3 comments · Fixed by #890
Assignees
Labels
C:x/evm EVM module Type: Tests issues and PR related to tests

Comments

@fedekunze
Copy link
Contributor

Sometimes the tests fail with a non-deterministic gas estimation:

--- FAIL: TestKeeperTestSuite (3.76s)
    --- FAIL: TestKeeperTestSuite/TestEstimateGas (0.46s)
        --- FAIL: TestKeeperTestSuite/TestEstimateGas/Case_contract_deployment (0.07s)
            grpc_query_test.go:764: 
                	Error Trace:	grpc_query_test.go:764
                	            				suite.go:77
                	Error:      	Not equal: 
                	            	expected: 0x121bda
                	            	actual  : 0x121bce
                	Test:       	TestKeeperTestSuite/TestEstimateGas/Case_contract_deployment

cc: @yihuang

@fedekunze fedekunze added Type: Bug Type: Tests issues and PR related to tests C:x/evm EVM module labels Sep 7, 2021
@devashishdxt
Copy link
Contributor

devashishdxt commented Sep 9, 2021

@devashishdxt
Copy link
Contributor

It is worth noting that the difference in expected value and actual value in both cases is 12.

expected - actual = 12

yihuang added a commit to yihuang/ethermint that referenced this issue Sep 27, 2021
@yihuang
Copy link
Contributor

yihuang commented Jan 6, 2022

yihuang added a commit to yihuang/ethermint that referenced this issue Jan 7, 2022
Closes: evmos#536

Solution: Use a fixed test account.

The source of non-deterministic is tx's intrinsic gas is different according to different number of zeros in input data,
so to make sure the gas number is reproducible, and the randomly generated test address is included in that.
fedekunze pushed a commit that referenced this issue Jan 7, 2022
Closes: #536

Solution: Use a fixed test account.

The source of non-deterministic is tx's intrinsic gas is different according to different number of zeros in input data,
so to make sure the gas number is reproducible, and the randomly generated test address is included in that.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:x/evm EVM module Type: Tests issues and PR related to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants