Skip to content

Add attestations test with payload_present in op pool#9531

Open
chong-he wants to merge 11 commits into
sigp:unstablefrom
chong-he:test-for-op-pool
Open

Add attestations test with payload_present in op pool#9531
chong-he wants to merge 11 commits into
sigp:unstablefrom
chong-he:test-for-op-pool

Conversation

@chong-he

@chong-he chong-he commented Jun 24, 2026

Copy link
Copy Markdown
Member

Add a test in operation pool about the index for the cases with and without payload_present.

Written with Claude Code and did a self review

Currently blocked waiting for ethereum/consensus-specs#5399 fix

@chong-he chong-he added test improvement Improve tests work-in-progress PR is a work-in-progress gloas labels Jun 24, 2026
Comment thread beacon_node/operation_pool/src/lib.rs Outdated
}

// Insert one more distinct PayloadAttestationMessage at a different slot
let new_slot = Slot::new(0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps this sort of test that checks we don't include payload attestations from old slots, should be a small separate test from the one testing the cap.

"Attestation after head slot should have index=0 when payload_present=false"
);
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Next steps should be:

  1. Make an OperationPool
  2. Insert all of the attestations created (from head slot, from the skipped slot, with and without payload_present)
  3. Check that op_pool.get_attestations orders the more profitable attestations with the correct payload_present field first.

I think this implies there are a few variations of this test:

  1. The payload is considered available (in state.execution_payload_availability), so we should pack index == 1 attestations first (because they earn the head reward).
  2. The payload is considered unavailable (in state.execution_payload_availability), so we should pack index == 0 attestations first (because they earn the head reward).
  3. Same as case (1) but hitting the limit on the number of attestations can be included, so we check that index == 1 attestations do get included, and that we prefer to exclude index == 0 attestations.
  4. Same as case (2) but checking that index == 0 get included and index == 1 get excluded once the capacity is reached.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@chong-he chong-he added blocked and removed blocked labels Jun 26, 2026
@chong-he chong-he changed the title Add payload_attestations test in op pool Add attestations test with payload_present in op pool Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked gloas test improvement Improve tests work-in-progress PR is a work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants