Add execution proof network test crate (optional-proofs-gloas-pr-5) - #44
Open
frisitano wants to merge 4 commits into
Open
Add execution proof network test crate (optional-proofs-gloas-pr-5)#44frisitano wants to merge 4 commits into
frisitano wants to merge 4 commits into
Conversation
Move the module tree into `lib.rs` so other testing crates can reuse `LocalNetwork`, the checks and the retry helper instead of duplicating node orchestration. The `simulator` binary keeps its subcommands and now builds on the library.
Let tests drive a production beacon node's proof pipeline without an `ere-verifier` build or a Beacon API: - `ClientConfig::proof_engine_override` injects a ready-built `ProofEngine` (never serialized) ahead of the `proof_engine` config, so each node can run its own mock verifier. - `Client::network_senders()` and `Client::network_globals()` expose the network channels and peer state for publishing proofs and reading peer scores. - `PendingPayloadCache::cached_execution_proof_types()` reports which proof types are cached for a block. - `ProofEngine` implements `Debug` so it can live in `ClientConfig`.
Add `testing/execution_proof_network_tests`, a deterministic multi-node harness for EIP-8025 execution proofs built on the simulator's `LocalNetwork`. Tests choose per node whether it runs a mock proof engine, which proof bytes it accepts and whether it carries validators; sign proof envelopes with the interop validator keys; submit them through a node (verify, cache, publish) or inject them unverified onto gossip; and observe verification, caching, storage and payload import on every node with bounded waits that print a per-node snapshot on timeout. Four scenarios cover the Gloas baseline (verifiers hold a payload until two proof types arrive), the end-to-end submit, propagate, verify and import path, invalid proof data rejected by a verifier that does not accept it, and an unsupported proof type rejected before verification. The two scenarios that need proof verification are ignored on this base: gossip verification loads the envelope from the store, which a proof-engine node fills only after two proofs, so submission fails with `PayloadUnavailable`. They carry the full assertions for when that is fixed. Tests bind the simulator's fixed ports, so `make test-execution-proof-network` runs them sequentially in release and the workspace test targets exclude the crate.
Keep `ClientConfig::proof_engine_override` out of production builds: the field, its default and the builder branch now exist only with the new `client/test-utils` feature, and `Config::proof_engine_override()` returns `None` without it. The execution proof network test crate enables the feature, and feature unification makes the field available to `beacon_node` and `node_test_rig` in that build.
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.
Summary
Adds
testing/execution_proof_network_tests, a reusable deterministic harness for multi-node EIP-8025 execution-proof integration tests, built on the simulator'sLocalNetworkrather than a second node orchestrator.NodeSpecchooses per node whether it runs a proof engine, which proof bytes that engine accepts, and whether it carries validators.ProofNetworkConfigsets validator count, slot duration, genesis delay and the Gloas fork epoch.MockProofEnginethrough a newClientConfig::proof_engine_overridefield, gated behind atest-utilsfeature on theclientcrate and never serialized, so valid and invalid proof data are chosen per scenario without anere-verifierbuild. Production builds oflighthousedo not enable the feature, andConfig::proof_engine_override()returnsNonethere.signed_execution_proofbuilds and signs envelopes with the deterministic interop validator keys.submit_execution_proofruns the same verify, cache, publish sequence the pending Beacon API endpoint will expose;publish_execution_proofinjects an unverified proof onto gossip, as a faulty peer would.ProofStatussnapshots, per node, whether the block is known, a valid proof of a type was verified, which proof types the pending payload cache holds, whether the envelope is stored, and whether fork choice has the payload. Waits are bounded and print every node's status and peer count on timeout.Production changes are small and additive: the simulator gains a library target (
main.rsnow uses it),Clientexposesnetwork_senders()andnetwork_globals(),PendingPayloadCachegainscached_execution_proof_types(),ProofEngineimplementsDebugso it can live inClientConfig, and the override field itself only exists withclient/test-utils.Known blocker on this base
GossipVerifiedExecutionProof::newloads the payload envelope withstore.get_payload_envelope, but a node with a proof engine persists the envelope only inimport_execution_payload_envelope, afterrequired_execution_proofs(2) are cached. So every proof reaching a proof-engine node fails withPayloadUnavailable, and the two scenarios that depend on proof verification cannot pass yet. A fallback topending_payload_cache.get_executed_payload_envelopewould resolve it; per conductor-nova that finding is routed to the EL-optional task (#42) rather than fixed here.Pending integration points (documented in the crate docs, not reimplemented)
submit_execution_proofis the in-process stand-in.Validation
Base:
535046063ae2152e351164843e2488b5bdc64746(origin/optional-proofs-gloas).cargo fmt --all -- --checkcargo clippywith the Makefile lint flags:clientandbeacon_nodewithouttest-utils, the test crate andclientwith itgloas_network_imports_payload_envelopes(release)unsupported_proof_type_is_rejected_before_verification(release)execution_proofs_propagate_verify_and_unlock_payload_importPayloadUnavailable(blocker above)invalid_proof_data_is_rejected_by_verifiers_that_do_not_accept_itPayloadUnavailablefailureRun the two ignored scenarios with
--run-ignored allonce the envelope lookup is fixed; they carry the full assertions and no other change is needed.Run the suite with
make test-execution-proof-network(cargo nextest run -p execution_proof_network_tests --release --test-threads 1). Tests bind the simulator's fixed ports, so they are serialised in-process and ignored in debug builds.Reviewer focus
beacon_node/client/src/config.rs: thetest-utils-gatedproof_engine_overridefield and its accessor; feature unification enables it for any build that includes the test crate.testing/execution_proof_network_tests/src/prover.rs: the submission adapter mirrors the future Beacon API handler; confirm the sequence matches the intended endpoint.testing/execution_proof_network_tests/src/tests.rs: topology and assertions for the four scenarios.