-
Notifications
You must be signed in to change notification settings - Fork 76
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(composer)!: Add chain_id check on executor build #1175
Conversation
Swapped sequencer client genesis get for sequencer client status get. Cleans up the code a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is moving in the right direction, thank you for bearing with me and working on it. :)
I have left a bunch of comments on what what I'd like to see changed to test this.
The tests are currently not set up in the most ideal way, but short of making the exit reason publicly observable I don't see a way for you to test it other than you did.
I would only ask for you to type out the returned errors so that the tests won't stop silently breaking (and yet still passing).
Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io>
@SuperFluffy I should be thanking you for bearing with me! Recent commits should implement all the changes you requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you very much!
I have left a few comments, primarily to not just throw away the error in get_sequencer_chain_id
. Please address these before merging.
assert_eq!(*actual, *configured_actual); | ||
} | ||
other @ EnsureChainIdError::GetChainId(_) => { | ||
panic!("expected `EnsureChainIdError::WrongChainId`, but got '{other}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last change before merge:
panic!("expected `EnsureChainIdError::WrongChainId`, but got '{other}'") | |
panic!("expected `EnsureChainIdError::WrongChainId`, but got '{other:?}'") |
^ I'd have done it myself but don't have push rights for your fork.
Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io>
## Summary Added check to ensure the executor's configured chain_id and the sequencer client's actual chain_id match. ## Background This check ensures that the composer is communicating with the sequencer RPC on the correct network. ## Changes Added chain_id check to the composer executor builder. Made executor builder async to accommodate for async communication with sequencer client. Moved nonce guard declaration from mock startup to individual tests in executor tests. Added function to mount a status response with a given chain_id to the mock. This is so the executor builder can gather the status response without throwing an HTTP 404 error. ## Testing Added executor test to validate the failure of an executor build with a chain_id mismatch. ## Related Issues Part of #986 --------- Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io> Co-authored-by: Ethan Oroshiba <ethan@astria.org>
Summary
Added check to ensure the executor's configured chain_id and the sequencer client's actual chain_id match.
Background
This check ensures that the composer is communicating with the sequencer RPC on the correct network.
Changes
Added chain_id check to the composer executor builder.
Made executor builder async to accommodate for async communication with sequencer client.
Moved nonce guard declaration from mock startup to individual tests in executor tests.
Added function to mount a status response with a given chain_id to the mock. This is so the executor builder can gather the status response without throwing an HTTP 404 error.
Testing
Added executor test to validate the failure of an executor build with a chain_id mismatch.
Related Issues
Part of #986