E537 new test case by ZanCorDX Β· Pull Request #894 Β· flashbots/rbuilder Β· GitHub
[go: up one dir, main page]

Skip to content

new test case#894

Open
ZanCorDX wants to merge 1 commit intodevelopfrom
dx/new-bundle-test
Open

new test case#894
ZanCorDX wants to merge 1 commit intodevelopfrom
dx/new-bundle-test

Conversation

@ZanCorDX
Copy link
Collaborator
@ZanCorDX ZanCorDX commented Mar 13, 2026

πŸ“ Summary

New test case.

βœ… I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@ZanCorDX ZanCorDX requested a review from dvush as a code owner March 13, 2026 16:27
@claude
Copy link
Contributor
claude bot commented Mar 13, 2026

Claude finished @ZanCorDX's task in 1m 35s β€”β€” View job


Review of PR #894

  • Read changed files and diff
  • Analyze code quality and correctness
  • Post review feedback

Summary: This PR refactors add_dummy_tx by extracting create_dummy_tx (returns the raw signed tx) and adds add_external_tx (adds a pre-built tx to the order builder). These are used by a new test_bundle_allow_tx_skip test that validates the allow_tx_skip behavior when two bundles share a reverting transaction.

Findings:

  1. Incomplete doc comment on create_dummy_tx + (setup.rs:123): The doc comment /// create_dummy_tx + is truncated/unclear. It should describe what add_dummy_tx does beyond create_dummy_tx (i.e., adds the tx to the order builder and returns the hash).

  2. Unnecessary .into() on tx_hash (setup.rs:134): *tx.hash() already returns B256 which is TxHash. The old code returned Ok(tx_hash) directly. The new code uses Ok(tx_hash.into()) β€” this is a no-op conversion. Not a bug, but unnecessary.

  3. Test doesn't verify allow_tx_skip=true is actually the cause: The test comments say the tx is skipped "because allow_tx_skip=true", but TestSetup always constructs PartialBlock::new(true) (i.e., discard_txs=true). A stronger test would also verify that with discard_txs=false, Bundle 2 would fail β€” confirming the behavior is actually gated on allow_tx_skip. Without that, the test could pass even if the skip logic were broken, as long as something else handles the stale nonce gracefully.

  4. No negative test for non-reverting tx with stale nonce: The test only covers skipping a tx that is in reverting_tx_hashes. It would be valuable to also test that a non-reverting tx with a stale nonce (i.e., TxRevertBehavior::NotAllowed) causes the bundle to fail, confirming the skip is conditional on revert behavior.

Overall the code is clean and the refactoring is reasonable. The main suggestion is to strengthen the test to actually validate the allow_tx_skip gate rather than only testing the happy path.

@ZanCorDX ZanCorDX requested a review from TymKh March 13, 2026 16:27
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.

1 participant

0