Skip to content

fix(testutil): serve decodable block and peer-count responses from the simnet mock - #589

Open
emlautarom1-agent[bot] wants to merge 2 commits into
mainfrom
fix/simnet-mock-block-flags
Open

fix(testutil): serve decodable block and peer-count responses from the simnet mock#589
emlautarom1-agent[bot] wants to merge 2 commits into
mainfrom
fix/simnet-mock-block-flags

Conversation

@emlautarom1-agent

Copy link
Copy Markdown
Contributor

Closes #585

Summary

Two endpoints of the simnet beacon mock returned responses pluto's own generated client cannot consume, so both callers warned on every poll.

GET /eth/v2/beacon/blocks/{block_id} omitted execution_optimistic and finalized. The beacon-API spec marks both required and non-nullable, so GetBlockV2ResponseResponse declares them as plain bool and the response failed to decode. At the smoke suite's 1s slots the inclusion checker warned roughly once per second per node, which is what tripped the Warn Log Rate gate.

GET /eth/v1/node/peer_count was not mounted at all. The readiness checker polls it every 60s, so each node warned once a minute and app_beacon_node_peers stayed pinned at zero — indistinguishable from a beacon node with no peers.

Charon does not hit either problem because its beaconmock is passed directly as an eth2wrap.Client interface, so those calls never cross HTTP. Pluto's mock is HTTP-only, so every method a consumer reaches needs an explicit route.

Each fix carries a test that drives the real generated client rather than asserting on the raw JSON body. Asserting the body is what let the first bug through: the existing test checked version and data and passed throughout.

all_pluto passes with no alerts detected, and neither warning appears in the log.

Out of scope

pluto_dkg and mixed_2_charon_2_pluto are named in the issue's acceptance criteria but are not exercised here.

Pluto sets a log topic almost nowhere, so its warnings land in topic="" and are counted by a gate that excludes charon's vmock/tracker equivalents. That asymmetry is tracked separately in #588 and is not addressed by this PR.

`GET /eth/v2/beacon/blocks/{block_id}` returned a `{version, data}`
envelope, so `get_block_v2` failed to decode and the inclusion checker
warned once per due slot. The beacon-API spec marks `execution_optimistic`
and `finalized` required and non-nullable, and every major client emits
both, so the generated client requires them too.
The readiness checker polls `GET /eth/v1/node/peer_count` once a minute.
Unmounted, it warned on every poll and left `app_beacon_node_peers` at a
flat zero, indistinguishable from a beacon node with no peers.

@emlautarom1-agent emlautarom1-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One note for reviewers.

Comment on lines +100 to +103
"connected": "80",
"connecting": "0",
"disconnected": "0",
"disconnecting": "0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Differs from charon. Charon's beaconmock sets only Connected: 80 and lets Go zero-value the rest. Here all four fields are required Strings on the generated GetPeerCountResponseResponseData, so omitting any one fails the decode rather than defaulting — which would trade this bug for a different warning on the same poll.

@emlautarom1
emlautarom1 marked this pull request as ready for review August 5, 2026 21:08

@emlautarom1 emlautarom1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Checked manually and it fixes part of the issues we're seeing on the smoke tests.

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.

Inclusion checker floods the warn log: simnet mock omits execution_optimistic on block responses

1 participant