Skip to content

testutil: vmock payload attestation and simnet e2e - #4670

Open
KaloyanTanev wants to merge 2 commits into
gloasfrom
kalo/gloas-ptc-validatormock
Open

testutil: vmock payload attestation and simnet e2e#4670
KaloyanTanev wants to merge 2 commits into
gloasfrom
kalo/gloas-ptc-validatormock

Conversation

@KaloyanTanev

Copy link
Copy Markdown
Collaborator

Add payload timeliness committee support to the validator mock: a stateless PayloadAttest (mirroring ProposeBlock) that fetches PTC duties and payload attestation data via charon, signs with DomainPTCAttester and submits versioned messages, scheduled at the 50% slot offset. Add WithDeterministicPTCDuties to beaconmock and fix its PTCDuties to include dependent_root/execution_optimistic metadata. Add a simnet e2e case asserting DutyPayloadAttestation is broadcast by all nodes with gloas activated via spec overrides.

category: test
ticket: #4324

@KaloyanTanev KaloyanTanev self-assigned this Aug 26, 2026
@KaloyanTanev
KaloyanTanev requested a lite review from Copilot August 26, 2026 16:13
@KaloyanTanev KaloyanTanev mentioned this pull request Aug 26, 2026
28 tasks

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends Charon’s test utilities to support the Gloas payload timeliness committee (PTC) flow by teaching the validator mock to perform DutyPayloadAttestation, enhancing beaconmock PTC duty responses/metadata, and adding a simnet e2e coverage case to assert payload attestation broadcast behavior under Gloas spec overrides.

Changes:

  • Add a stateless PayloadAttest duty implementation to validatormock and wire it into the duty runner/scheduling.
  • Add deterministic PTC duties support to beaconmock, and ensure PTC duties responses include expected metadata (dependent_root, execution_optimistic).
  • Add a simnet e2e test case enabling Gloas via spec overrides and asserting DutyPayloadAttestation behavior with mock VCs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testutil/validatormock/payloadattest.go Implements payload timeliness committee signing and submission for the validator mock.
testutil/validatormock/component.go Wires DutyPayloadAttestation into duty execution and duty start-time scheduling.
testutil/integration/simnet_test.go Adds a simnet e2e scenario for payload attestations with Gloas activated via spec overrides.
testutil/beaconmock/options.go Adds WithDeterministicPTCDuties option to generate PTC duties deterministically.
testutil/beaconmock/beaconmock.go Wraps PTC duties responses with metadata required by the beacon API response shape.
Suppressed comments (1)

testutil/validatormock/payloadattest.go:86

  • This nil-check is for the fork-specific payload attestation data (versioned.Gloas), but the error message is the same as the earlier versioned-wrapper nil-check. Consider making it fork-specific to clarify what was nil.
	if data == nil {
		return errors.New("payload attestation data is nil")
	}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread testutil/beaconmock/options.go
Comment thread testutil/validatormock/payloadattest.go
Comment thread testutil/validatormock/payloadattest.go
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (1)

testutil/validatormock/payloadattest.go:73

  • The nil/error branches for payload attestation data (dataResp.Data == nil and later versioned.Gloas == nil) are new behavior but currently aren’t covered by payloadattest_test.go. Adding targeted subtests would make these failure modes deterministic and prevent regressions in the early-return/error handling.
	versioned := dataResp.Data
	if versioned == nil {
		return errors.New("versioned payload attestation data is nil")
	}

@github-actions github-actions Bot added the branch-invalid PR raised against invalid branch. Not a main or release branch. label Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (gloas@c02d596). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             gloas    #4670   +/-   ##
========================================
  Coverage         ?   58.79%           
========================================
  Files            ?      246           
  Lines            ?    34818           
  Branches         ?        0           
========================================
  Hits             ?    20471           
  Misses           ?    11794           
  Partials         ?     2553           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-invalid PR raised against invalid branch. Not a main or release branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants