Skip to content

corpus-gen: support starknet_estimateFee, starknet_simulateTransactions and starknet_call #4056

Description

@infrmtcs

bench/rpc/cmd/corpus-gen covers the read and trace APIs but not the execution methods (see bench/rpc/README.md). Add estimateFee, simulateTransactions and call subcommands so the k6 harness can benchmark them.

Idea

Sample a block N, then use real transactions from block N+1 as the request payload against block_id = N:

  • estimateFee / simulateTransactions: request / transactions = a prefix of block N+1's transactions (a contiguous prefix keeps nonces valid and signatures verifiable, so SKIP_VALIDATE is not required). Both take the same broadcasted-transaction list, so they should share one sampler.
  • call: derive a FUNCTION_CALL from an invoke transaction in block N+1.

Notes for the implementer

  • v0_10 BroadcastedTransaction only accepts version 0x3. L1_HANDLER cannot be broadcast. DECLARE needs the full contract_class instead of class_hash. transaction_hash should be stripped.
  • --block-end must be capped at latest−1 so N+1 exists.
  • run.js counts JSON-RPC errors as failures, so requests that revert or fail estimation degrade the benchmark. Consider how to keep the corpus clean.

Follow the existing sampler pattern (newSampledCmd, blockRangeFlags, --batch) and update README.md and corpus/all.json.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions