Conversation
- Collapse opcodes.rs from 215 to 18 lines (remove struct boilerplate) - Refactor FlowBuilder: Action enum with struct variants, inline encoding - build()/build_raw() now take &self instead of &mut self - Peephole optimizer: O(n) retain instead of O(n²) reverse-remove - Replace hardcoded selector with documented EXECUTE_ACTIONS_SELECTOR const - Fix off-by-one assert in call() (< u16::MAX -> <= u16::MAX) - Upgrade alloy dev-dep 1.2.1 -> 1.7, migrate test API accordingly - Rename ONEHUNDRED_ETH -> TEN_ETH (value was 10e18, not 100e18) - Fix typos and remove debug comments in tests - Add test_execute_actions_selector (selector drift guard) - Add test_flow_builder_max_data_length (off-by-one regression guard) - Fix CONTRIBUTING.md placeholder URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comprehensive refactor focused on readability, reduced boilerplate, and dependency freshness.
Changes
Core Refactor
opcodes.rs— Collapsed from 215 → 18 lines. Removed all 10 opcode struct/impl pairs; encoding logic moved inline into theActionenum inflow_builder.rs. Only the 12 opcode byte constants remain.flow_builder.rs— Major cleanup:Actionenum now uses struct variants directly (no separate opcode structs)build()/build_raw()take&selfinstead of&mut self— they never mutated stateretainexecuteActions()selector replaced with a namedEXECUTE_ACTIONS_SELECTORconstant (documented, verified by a unit test)data.len() < u16::MAX→data.len() <= u16::MAX as usizeDependency Upgrade
alloydev-dependency upgraded from1.2.1→1.7tokiodev-dependency relaxed from1.44→1Test Cleanup & Migration
ONEHUNDRED_ETH→TEN_ETH(value was10e18, not100e18)"shoud shave"typos, removed"?? ?AHHH"debug commentson_anvil()→connect_anvil(),on_anvil_with_config()→connect_anvil_with_config()AnvilTestProvidertype alias →impl Provider + AnvilApi<Ethereum>FillProvider,JoinFill,Identity, etc.)New Tests
test_execute_actions_selectorkeccak256("executeActions()")test_flow_builder_max_data_lengthu16::MAXbyte payloads are acceptedDocumentation
ONEHUNDRED_ETH→HUNDRED_ETH, removed unusedBytesimport, corrected crate namemultiplexer→multiplexer_evmBitFinding/multiplexerVerification
Stats