Skip to content

Conversation

@ericvelazquez
Copy link
Contributor

@ericvelazquez ericvelazquez commented Oct 15, 2024

Ticket

What does this PR do?

  • Summary: Currently we use the non-standard but much more performant "eth_getBlockReceipts" RPC method to get all the receipts for a block. Since this is non-standard however, some RPCs do not support it.
  • Key Changes:
    • Adding a receiptsFetcher in the rpc-client struct.
    • This receiptsFetcher is imported from the op source code
    • Removed Config interface. Using the struct instead

Does this PR introduce any breaking changes (API/schema)?

  • No

Do any environment variables need to be updated or added before deployment?

  • No

How can this PR be tested?

  • Unit & integration tests

@linear
Copy link

linear bot commented Oct 15, 2024

SEQ-182 Implement fallback for getting block receipts

Currently we use the non-standard but much more performant "eth_getBlockReceipts" RPC method to get all the receipts for a block. Since this is non-standard however, some RPCs do not support it

geth has a component with a bunch of logic and fallbacks around getting receipts: https://github.com/ethereum-optimism/optimism/blob/4f1e8a7036e1f85fb1754ca1bb08a461c7c50ac4/op-service/sources/receipts_rpc.go#L61

We should either re-use this component or duplicate some similar logic for if that method isnt available

@ericvelazquez ericvelazquez marked this pull request as ready for review October 17, 2024 13:09
Copy link
Collaborator

@jorgemmsilva jorgemmsilva left a comment

Choose a reason for hiding this comment

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

I think this is an excellent change, good catch on the non-standard method being used! 💪

left a few comments about best practices and how we organize the code

@ericvelazquez ericvelazquez merged commit 28c212f into main Oct 18, 2024
2 checks passed
@ericvelazquez ericvelazquez deleted the SEQ-182 branch October 18, 2024 10:06
@ericvelazquez ericvelazquez restored the SEQ-182 branch October 21, 2024 19:32
@ericvelazquez ericvelazquez deleted the SEQ-182 branch November 25, 2024 23:58
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.

5 participants