Skip to content

PLT-461: StorageRW scenario scaffold + deploy wiring#47

Open
bdchatham wants to merge 3 commits into
mainfrom
brandon2/plt-461-storagerw-scaffold
Open

PLT-461: StorageRW scenario scaffold + deploy wiring#47
bdchatham wants to merge 3 commits into
mainfrom
brandon2/plt-461-storagerw-scaffold

Conversation

@bdchatham

Copy link
Copy Markdown
Contributor

Implements PLT-461 — makes StorageRWv1 reachable as a sei-load scenario. Scaffold only; per-tx key/size distribution comes in PLT-465.

What

  • New generator/scenarios/StorageRW.go mirroring ERC20Conflict.go (ContractScenarioBase[bindings.StorageRWv1], parameterless mapping-backed deploy), registered as "storagerw" in the factory.
  • Fixed rmw(slot=0, empty pad) to prove the deploy+send path end-to-end. auth.GasLimit = 50000 (matches sibling scenarios; the 200k default under-packs blocks ~7×). Mock-deploy + full-calldata + selector test.

Review (solidity + idiom)

  • Binding usage verified correct (parameterless deploy, empty-bytes pad encoding, nonce sequencing). Idiom: faithful ERC20Conflict mirror.
  • Note: fixed single-slot rmw is a scaffold; PLT-465 (distribution wiring) is the gate before any real throughput numbers. Follow-up PLT-472 filed for the drifted scenario-generator script (hand-written here).

Decision brief: designs/sei-load-workload-modeler/PLT-461-storagerw-scaffold.md.

🤖 Generated with Claude Code

bdchatham and others added 2 commits June 12, 2026 07:53
Add a "storagerw" scenario over the PLT-457 StorageRWv1 binding, mirroring
ERC20Conflict: a ContractScenarioBase[StorageRWv1] that deploys the
mapping-backed contract (no constructor args), binds it, and produces a
fixed rmw tx against slot 0 with an empty pad. This proves the contract is
reachable as a scenario end-to-end; the per-tx slot/value/pad distribution
lands in PLT-465.

Register "storagerw" in the factory's auto-generated block. Hand-written
to match the current ERC20Conflict idiom rather than via `make generate`:
the template script still emits the pre-PLT-457 signatures
(NewXScenario()/NewContractScenarioBase(scenario)) and a sol-derived name,
neither of which matches current base.go or the ticket's "storagerw" name.

Test mirrors the mock-deploy generator coverage at the scenario level:
attach at a known address, generate, and assert the tx targets the contract
and carries the rmw selector (cross-checked against the binding ABI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The rmw scaffold tx left auth.GasLimit at the 200k CreateTransactionOpts
default while every sibling scenario tunes it. On a gas-limit-admission
chain that under-packs blocks by ~7x, depressing observed TPS. rmw is
SLOAD+SSTORE on one slot (~26k warm, ~44k cold-first); 50k covers
cold-first-touch with headroom and packs ~4x denser. PLT-465 revisits
once the calldata pad is distribution-driven.

Pin the fixed scaffold calldata in the test (slot 0, empty pad).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jun 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Load-generator scaffolding and tests only; no changes to auth, persistence, or production runtime paths.

Overview
Adds a new storagerw load scenario that deploys/binds StorageRWv1 and generates fixed rmw(slot=0, empty pad) transactions to exercise SLOAD + SSTORE under load. It follows the existing ContractScenarioBase pattern (deploy, attach, mock-deploy) and registers NewStorageRWScenario in the scenario factory.

Each tx sets GasLimit to 50k (documented in new doc.go section) so block admission isn’t dominated by the default 200k limit; per-tx slot/pad distribution is explicitly deferred to PLT-465.

Tests cover factory lookup by name and mock-deploy Generate output (contract To, rmw selector, and pinned ABI encoding for slot 0 / empty bytes).

Reviewed by Cursor Bugbot for commit 74e53ed. Bugbot is set up for automated code reviews on this repo. Configure here.

Add generator/scenarios/doc.go documenting the contract-scenario pattern
(ContractScenarioBase/ContractDeployer, MockDeploy attach, factory registration)
and the StorageRW scaffold with the full gas-sizing derivation.

Lean StorageRW.go: consolidate the three PLT-465 deferral notes to one terse
note, and reduce the dense gas comment to a critical one-liner plus a pointer
to the package doc. Comments and doc only; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham requested review from amir-deris and masih June 12, 2026 21:32
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.

1 participant