Closed joshklop closed 1 month ago
The pull request introduces enhancements to the end-to-end testing framework by modifying the Makefile
to include additional command-line options for test configurations. It restructures private key management in the OPStack
type, replacing a single private key with two distinct keys. The StackConfig
in stack.go
is simplified to manage user accounts more efficiently, and the handling of secrets is improved. Adjustments in the test files ensure that user accounts are represented by private keys, enhancing the accuracy of transaction operations.
File(s) | Change Summary |
---|---|
Makefile |
Added command-line options to the e2e target for specifying L1 and L2 allocations, deployments, and configuration files. |
e2e/op_stack.go |
Replaced single private key with batcherPrivKey and proposerPrivKey . Updated NewOPStack constructor and Run method to accommodate the new key structure. |
e2e/stack.go |
Removed L1User struct; StackConfig now holds a single user private key. Updated Setup function to use copied deployment configurations and improved secrets handling. |
e2e/stack_test.go |
Changed user account representation to a private key (userPrivKey ). Updated transaction functions to use the derived user address for accuracy in transactions and balance checks. |
e2e/state_dump.go |
Removed file containing functionality for managing and decoding Ethereum state dumps, including structures and methods related to state representation. |
go.mod |
Removed direct dependency on github.com/ethereum-optimism/go-ethereum-hdwallet , retaining it as an indirect dependency. |
e2e/op_stack.go
regarding the handling of private keys and transaction management are related to the modifications in the main PR, which also involves the OPStack
type and its private key management.Makefile
in this PR include the addition of a new target and variable, which aligns with the enhancements made to the e2e
target in the main PR, indicating a connection in the build process and command-line options.🐇 In the meadow where bunnies play,
Changes hop in a joyful way.
Keys now split, oh what a sight,
Testing's clearer, all feels right!
With options new, we leap and bound,
In code's embrace, our joy is found! 🌼
e2e/stack.go (5)
`20-21`: **LGTM!** The new imports are relevant and necessary for the changes made in the file. --- `45-45`: **Simplification of user management looks good!** Replacing the `Operator` and `Users` fields with a single `User` field of type `*ecdsa.PrivateKey` simplifies the user management in the stack configuration. This is a cleaner approach compared to managing a list of users. --- `102-108`: **Configuration management improvements look good!** The changes made to use a copied `deployConfig` from `ope2econfig`, set a smaller `SequencerWindowSize`, and use predefined allocations and deployments from `ope2econfig` centralize the configuration management and improve the test setup. The smaller `SequencerWindowSize` is intended to force unsafe block consolidation to happen more often for faster test runs, which is a reasonable approach for testing purposes. --- `162-171`: **Improved handling of L2OutputOracleCaller and secrets looks good!** Creating `l2OutputOracleCaller` using `ope2econfig.L1Deployments.L2OutputOracleProxy` is consistent with the centralized configuration management approach. Fetching `secrets` using `e2eutils.DefaultMnemonicConfig.Secrets()` improves the handling of sensitive information by using a utility function instead of generating user accounts on-the-fly. --- `176-178`: **Improved OPStack creation and user management in StackConfig looks good!** Using `ope2econfig.L1Deployments.L2OutputOracleProxy`, `secrets.Batcher`, and `secrets.Proposer` in `NewOPStack` is consistent with the centralized configuration management approach and leverages the improved secrets handling. Setting the `User` field in `StackConfig` to `secrets.Alice` simplifies the user management in the stack configuration. Also applies to: 232-232
There are probably even more ways we can simplify the e2e tests, but this was the low-hanging fruit.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores