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

Fix transfer prestate trace #2075

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Conversation

palango
Copy link
Contributor

@palango palango commented Apr 26, 2023

Description

Running the pretracer on a simple celo transfer failed with an exception in the js pretracer.

failed to retrieve trace result: TypeError: cannot read property '0xbeb299010df30f07d6e6ac00426409...' of null    in server-side tracer function 'result'

This happened, because in that case the result wasn't properly initialized.

This problem has been fixed upstream in ethereum/go-ethereum#24268. As that PR also includes the addition of the native prestate tracer, I just applied the fix and left other changes for a later merge.

I also added a testcase for a simple transfer to prevent regressions.

Issues

Fixes #2066

@palango palango force-pushed the palango/fix-transfer-prestate-trace branch from 91ce8e8 to 59600c6 Compare April 26, 2023 12:12
@github-actions
Copy link

github-actions bot commented Apr 26, 2023

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit 47596d3

coverage: 48.5% of statements across all listed packages
coverage:  63.1% of statements in consensus/istanbul
coverage:  40.1% of statements in consensus/istanbul/announce
coverage:  53.1% of statements in consensus/istanbul/backend
coverage:   0.0% of statements in consensus/istanbul/backend/backendtest
coverage:  24.3% of statements in consensus/istanbul/backend/internal/replica
coverage:  61.2% of statements in consensus/istanbul/core
coverage:  45.0% of statements in consensus/istanbul/db
coverage:   0.0% of statements in consensus/istanbul/proxy
coverage:  64.4% of statements in consensus/istanbul/uptime
coverage:  51.8% of statements in consensus/istanbul/validator
coverage:  79.2% of statements in consensus/istanbul/validator/random

@github-actions
Copy link

github-actions bot commented Apr 26, 2023

5803 passed, 1 failed, 46 skipped

Test failures:
  TestEthersJSCompatibility: e2e_test
Checking getExchangeSpenders. spenders = [0x000000000000000000000000000000000000d028]
Checking medianRate. numerator = 1000000000000000000000000 denominator = 1000000000000000000000000
Checking gas price minimum. cusdValue = 100000000
executing mocha test with /usr/local/bin/npm run test --networkaddr=http://127.0.0.1:33835 --blocknum=0x0 -- --grep ethers.js compatibility tests with state

ethersjs-api-check@1.0.0 test
mocha -r ts-node/register test/*.ts --grep ethers.js compatibility tests with state

ethers.js compatibility tests with state
✔ provider.getBlock works (block has gasLimit set) (63ms)
✔ EIP-1559 transactions supported (can get feeData) (41ms)
✔ block has gasLimit
✔ block has baseFeePerGas

4 passing (141ms)

panic: runtime error: invalid memory address or nil pointer dereference
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1209 +0x24e
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1212 +0x218
/opt/hostedtoolcache/go/1.17.5/x64/src/runtime/panic.go:1038 +0x215
/home/runner/work/celo-blockchain/celo-blockchain/core/types/block.go:443 +0x30
/home/runner/work/celo-blockchain/celo-blockchain/e2e_test/e2e_test.go:537 +0x56a
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1259 +0x102
/opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1306 +0x35a

This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (ebe6ae7) 54.27% compared to head (59600c6) 54.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2075      +/-   ##
==========================================
- Coverage   54.27%   54.26%   -0.01%     
==========================================
  Files         692      692              
  Lines      115642   115642              
==========================================
- Hits        62761    62757       -4     
- Misses      49044    49056      +12     
+ Partials     3837     3829       -8     

see 29 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@eelanagaraj eelanagaraj left a comment

Choose a reason for hiding this comment

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

LGTM!

@palango palango disabled auto-merge April 27, 2023 12:23
@palango palango enabled auto-merge (squash) April 27, 2023 12:23
@palango palango disabled auto-merge April 27, 2023 14:29
@palango palango merged commit 47596d3 into master Apr 27, 2023
20 of 22 checks passed
@palango palango deleted the palango/fix-transfer-prestate-trace branch April 27, 2023 14:29
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.

method handler crashed error for prestateTracer
2 participants