Skip to content

[WIP] Sync with upstream#4

Draft
dmitriy-b wants to merge 13 commits into
forks/amsterdamfrom
feat/spamoor-to-est
Draft

[WIP] Sync with upstream#4
dmitriy-b wants to merge 13 commits into
forks/amsterdamfrom
feat/spamoor-to-est

Conversation

@dmitriy-b
Copy link
Copy Markdown
Collaborator

Draft PR to sync feat/spamoor-to-est with upstream

dmitriy-b and others added 13 commits April 20, 2026 18:11
Adds a pytest plugin that signs spamoor helper dicts and commits the
resulting transactions on a Nethermind node via Marcin Sobczak's
testing-namespace JSON-RPC.

Two modes behind --bloat-commit-mode:
- build: testing_buildBlockV1 + engine_newPayloadVn + engine_forkchoiceUpdatedVn
- commit: testing_commitBlockV1 (single-shot; client advances head itself)

Also exposes an `est execute testing-build-block` subcommand and mirrors
the three spamoor scenarios (eoatx, calltx, factorydeploytx) under
tests/benchmark/testing_build_block/ so they can be driven against a
real client.

Refs: docs/meetings/2026-04-17-ef-stateful-sync.md
`EOA.__new__` short-circuits when its `address` argument is already an
`EOA` instance, returning the existing object unchanged and silently
dropping the `nonce` kwarg. `bloat_signer` was therefore pinning nonce
to 0 regardless of on-chain state, so every scenario after the first
failed with `nonce too low` / `payload processing failed`.

Wrap the probe as a plain `Address` to force re-construction with the
freshly fetched nonce. Verified by chaining eoatx → calltx →
factorydeploytx against a local Nethermind: block 1 → 2 → 3, signer
nonce 5 → 10 → 16.
feat(testing-build-block): wire spamoor scenarios through testing_* RPCs
…package

Add a sibling pyproject.toml in tests/benchmark/spamoor/ that maps the
directory to a pip-installable package named eels-spamoor-builders. The
12 build_<verb>_transactions helpers in helpers.py become reusable as a
self-contained library by downstream tooling, without inheriting the
rest of execution-specs.

Layout: the directory stays in place; the new pyproject's
tool.setuptools.package-dir maps "." to "eels_spamoor_builders" so the
wheel exposes the dir under that name. tests/benchmark/spamoor/__init__.py
gains re-exports of the 12 builders. Existing relative imports inside
test_*.py and pool_runner.py (`from .helpers import …`) are unchanged
and continue to work in pytest collection.

Verified end-to-end:
- python -m build --wheel  → eels_spamoor_builders-0.1.0-py3-none-any.whl
- pip install <wheel>      → pulls only eth-abi + eth-utils + eth-hash + eth-typing
- from eels_spamoor_builders import build_eoatx_transactions  → works
- build_eoatx_transactions(count=3, …) returns 3 well-formed type-2 txs

Optional `[test]` extra installs pytest for the spamoor_signer_context /
broadcast_and_assert_receipts helpers, which import pytest +
execution_testing.test_types lazily and aren't needed by builder-only
consumers.
Four valid points from the bot review on PR #3:

- README rpc_client example was wrong: lambda returned the JSON-RPC envelope
  ({"jsonrpc": "2.0", "result": "0x0"}) but the builders expect the unwrapped
  result. Replace with a function that returns "0x0" for eth_getTransactionCount
  and a feeHistory dict for eth_feeHistory, matching the actual call shape in
  build_eoatx_transactions and the 11 sister builders.

- README's "pip install eels-spamoor-builders[test]" wouldn't work for a
  VCS-installed package. Drop the [test] extra entirely instead — the
  spamoor_signer_context / broadcast_and_assert_receipts helpers are not
  part of the build_* public API, and the suggested pytest-only extra was
  also incomplete (missing execution_testing). Document manual install for
  consumers that want them.

- pyproject.toml [test] extra dropped (see above). Replaced with a comment
  pointing to the README's manual-install note.

- __init__.py docstring claimed the builders "build signed Spamoor
  transactions". They actually return unsigned tx dicts; signing happens
  later via spamoor_dict_to_transaction. Reword to "build Spamoor
  transaction dictionaries" and call out that signing is downstream.

Re-verified end-to-end against the orchestrator's existing usage:
  build_eoatx_transactions(count=3, ..., rpc_client=...) returns 3
  unsigned type-2 dicts with nonces from rpc_client, maxFeePerGas =
  basefee*(1+throughput), signed=False.
chore(spamoor): publish builders as standalone eels-spamoor-builders package
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.

2 participants