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

[1/N] Batch transactor: wait for n confirmations for a transaction #99

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Dec 4, 2023

Why are these changes needed?

Currently, transactor assumes a transaction is successful as soon as transaction receipt is available without waiting for any confirmations.
This PR adds a way to wait for a specified number of confirmations.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim force-pushed the txn-confirmations branch 6 times, most recently from 3853fe3 to ef08bf1 Compare December 4, 2023 19:47
@ian-shim ian-shim changed the title wait for n confirmations for a txn Wait for n confirmations for a transaction Dec 4, 2023
@ian-shim ian-shim marked this pull request as ready for review December 4, 2023 19:50
@ian-shim ian-shim force-pushed the txn-confirmations branch 3 times, most recently from 222babe to c9e4fe1 Compare December 5, 2023 00:08
@ian-shim ian-shim changed the title Wait for n confirmations for a transaction [1/N] Batch transactor: wait for n confirmations for a transaction Dec 6, 2023
Copy link
Collaborator

@mooselumph mooselumph left a comment

Choose a reason for hiding this comment

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

Looks good, just one question.

@@ -31,6 +32,7 @@ type EthClient struct {
NoSendTransactOpts *bind.TransactOpts
Contracts map[gethcommon.Address]*bind.BoundContract
Logger common.Logger
numConfirmations int
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think this is this is generally a global setting or would it be something that would vary between different types of calls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should be something each component sets globally and hidden from callers for now, although i can see there may be a need to override for different types of calls in the future if we have a lot more different types of calls.

@ian-shim ian-shim merged commit 58b631f into Layr-Labs:master Dec 13, 2023
4 checks passed
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