Repository navigation
Conversation
Contributions go to the highest layer that can express them: spammer
config, plugin, or core primitive (docs/contributing-workloads.md).
The first primitive unifies the three placeholder implementations
(utils/abi.go, taskrunner, calltx) into utils.Placeholders with nested,
innermost-first resolution, and adds {create2:factory:hash:salt}.
scenario.TxPlaceholders adds {factory_address}; eoatx resolves --to per
tx, geastx resolves {factory_address} in geas code. Both are exported to
plugins.
spammer-configs/create2-receiver-transfers.yaml expresses ETH transfers
to a CREATE2 contract set with factorydeploytx + eoatx and no
scenario-specific Go code.
There was a problem hiding this comment.
Summary
The PR adds a shared placeholder resolver (utils/placeholders.go, scenario/placeholders.go) replacing three duplicated implementations, a CREATE2 address placeholder, per-tx --to resolution in eoatx, regenerated plugin symbols, a contribution-model guide, and a new EIP-7702 delegation plugin example. The refactor is coherent and the new example's constants check out (init-code hashes match); the only real defect is the salt parsing in the new CREATE2 resolver, which is still unfixed since the last review.
Issues
- 🟡
utils/placeholders.go:102— CREATE2 salt parsed with base 0, so leading-zero decimals become octal — see the thread on that line
Reviewed @ 296bec4d
"The bug is always in the last place you look — because you stop looking after you find it."
| if err != nil { | ||
| return common.Address{}, err | ||
| } | ||
| salt, ok := new(big.Int).SetString(parts[2], 0) |
There was a problem hiding this comment.
🟢 salt parsed with base 0, so leading-zero decimal salts become octal
SetString(parts[2], 0) uses Go's base-0 mode: a salt like 0100 silently parses as octal 64 (and 0b/0o/underscore forms are also accepted), contradicting the documented 'decimal or 0x uint256' encoding and yielding a wrong CREATE2 address with no error. Parse 0x-prefixed salts separately and use base 10 otherwise.
Adds plugins/_example-delegation, an EIP-7702 delegated-counter plugin whose receipt-dependent setup cannot be expressed as a spammer config, and an Examples section in docs/contributing-workloads.md pointing to the config, plugin and core-primitive references.
RedPandaBot v2 prototypeReviewed head No verified findings. Automatic approval is disabled for the v2 prototype. |
Why
Recent contributions (#289, #290, #291, #296) add workload-specific features to generic scenarios, e.g. two copies of a ~270-line CREATE2 target-pool package in
eoatxandcalltx. This PR proposes a structure where workloads are contributed at the highest layer that can express them, and core only accepts primitives.Contribution model (
docs/contributing-workloads.md)geastx,calltx,eoatx,factorydeploytx,taskrunner). Default.--plugin <url>. Not reviewed by core.First primitive: shared placeholders
utils.Placeholdersreplaces three separate implementations (utils/abi.go,taskrunner,calltx). Resolution is innermost-first, so placeholders nest; unknown names are left untouched, so JSON and geas braces are safe.{create2:<factory>:<initcodehash>:<salt>}.scenario.TxPlaceholders(walletPool, txIdx)adds{factory_address};scenario.Create2FactoryAddressreplaces the duplicated factory derivation in calltx.eoatx:tois resolved per tx and validated at init.geastx:{factory_address}is resolved in geas code/files.One example per layer
spammer-configs/create2-receiver-transfers.yaml:factorydeploytx+eoatxto{create2:...}targetsplugins/_example-delegation: deploy counter → EIP-7702 delegate an EOA → send txs to the EOA (receipt-dependent setup a config cannot express){create2:...}/{factory_address}placeholders, mapped to the core checklist in the guidePlugin verified on anvil: 40 txs → authority storage slot 0 = 40; passes
validate-pluginas a directory and as themake pluginsarchive.Proof
spammer-configs/create2-receiver-transfers.yamlexpresses #289's CREATE2 use case (ETH transfers to a CREATE2 contract set) withfactorydeploytx+eoatxand no scenario-specific Go code:Verification
{factory_address}+{txid}incall_args: calldata contains the factorydeploytx factory address; txs succeed.scenario.TxPlaceholderspassesspamoor-utils validate-plugin.go test ./...,go vet ./...pass;staticcheckreports only the existing SA1019 warnings in generated symbols.Open questions
ethpandaops/spamoor-pluginsrepo is the alternative.plugin: <url>import item would make plugin-backed library configs self-contained, but importing a config would then run remote Go code, so it must respect the disable-plugin-API setting. Not implemented here.Min_Version: v1.2.5assumes the next release.