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: eth_getBlockReceipts API implementation #12505

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

aarshkshah1992
Copy link
Contributor

@aarshkshah1992 aarshkshah1992 commented Sep 23, 2024

Closes #12429.
This is a port over of the work done by @virajbhartiya at #12478.
Just adding in the last bit and taking it to completion here as we need it for the upcoming Lotus release.

@aarshkshah1992
Copy link
Contributor Author

@virajbhartiya @rvagg

Fixed some bugs & did some refactoring to @virajbhartiya 's original work. Main highlights:

  • Once we have the receipts after re-executing the tipset, we can simply fetch the events from the event Index DB(the Index DB also persists events for reverted tipsets).
  • There is no need to re-load the events here and do all the grunt work that the eth_getLogs API already does for you.
  • The msgCid that newEthTx needs is the "message inclusion tipset cid" which this new API already gets from the user. Passing the parent of that tipset to newEthTx is a bug and so fixed it.
  • Removed all changes made to the EventFilter and that file is now unchanged.

CHANGELOG.md Outdated Show resolved Hide resolved
itests/fevm_test.go Outdated Show resolved Hide resolved
@rvagg
Copy link
Member

rvagg commented Sep 26, 2024

I had a go at dealing with the gas mismatch - it's because the basefee needs to be from the executed tipset but we don't have that, so we need to reach in and calculate it from the list of messages. I refactored newEthTxReceipt to just take what it needs and avoid the synthetic MsgLookup object.

@rvagg
Copy link
Member

rvagg commented Sep 26, 2024

err #12514 is what I meant to link to

@aarshkshah1992
Copy link
Contributor Author

CI failure itest_eth_block_hash is a known flaky. Works locally.

@rvagg rvagg force-pushed the feat/eth-block-get-receipts-api branch from f8857f1 to 97d311b Compare September 26, 2024 05:54
@rvagg rvagg force-pushed the feat/eth-block-get-receipts-api branch from 97d311b to 22b705c Compare September 26, 2024 05:56
@aarshkshah1992
Copy link
Contributor Author

Reviewed it all once again and lgtm.

@aarshkshah1992 aarshkshah1992 merged commit f33d4a2 into master Sep 26, 2024
82 of 83 checks passed
@aarshkshah1992 aarshkshah1992 deleted the feat/eth-block-get-receipts-api branch September 26, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

Support eth_getBlockReceipts
4 participants