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

Filter for tx receipts with any obscuro interactions #1509

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

BedrockSquirrel
Copy link
Collaborator

Why this change is needed

Currently we only send tx receipts to the enclave for L1 transactions addressed to an obscuro contract (message bus or management contract).

However we need to capture receipts for any transaction that interacts with those contracts even if the transaction is not addressed to the contract directly.

This was breaking local network and testnet networks deployments because the whitelist ERC20 bridge script was failing.

What changes were made as part of this PR

Make an eth_getLogs call to fetch all logs in the block and scan through them to see if they come from the obscuro relevant contracts.

Send receipts for those transactions.

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@BedrockSquirrel BedrockSquirrel force-pushed the matt/fix-receipt-filtering branch from 0e8389e to ef5e75d Compare September 11, 2023 21:56
if !g.submitDataLock.TryLock() {
g.logger.Info("Unable to submit block, already submitting another block")
// we are already submitting a block, and we don't want to leak goroutines, we wil catch up with the block later
return false, nil
}
receipts, err := g.sl.L1Repo().FetchObscuroReceipts(block)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved this after the TryLock because we sometimes end up duplicating the effort otherwise.

@BedrockSquirrel BedrockSquirrel merged commit 28d007b into main Sep 12, 2023
2 checks passed
@BedrockSquirrel BedrockSquirrel deleted the matt/fix-receipt-filtering branch September 12, 2023 09:55
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.

2 participants