Documentation ¶
Index ¶
- Constants
- func ChainID() *big.Int
- func EndWithRootHash() types.Bytes32
- func Initialize()
- func L2BridgeAddress() *common.Address
- func MaxL1L2ReceiptPerBlock() int
- func MaxL2L1LogsPerBlock() int
- func MaxTxByteSize() int
- func MaxTxPerBlock() int
- func MinTxByteSize() int
- func NumBlock() int
- func Ofile() string
- func Seed() int64
- func StartFromBlock() int
- func StartFromRootHash() string
- func StartFromTimeStamp() uint64
- func ZeroesInCalldata() bool
- type RandGen
- func (g *RandGen) Address() *common.Address
- func (g *RandGen) AnyTypeTxRlp() (res string)
- func (g *RandGen) AppendAddress(s string) string
- func (g *RandGen) BigInt(n int64) *big.Int
- func (g *RandGen) Bytes(nb int) []byte
- func (g *RandGen) CallData() []byte
- func (g *RandGen) DynFeeTx() string
- func (g *RandGen) EIP2930Tx() string
- func (g *RandGen) FromAddresses(numTxs int) (fromAddresses []types.EthAddress)
- func (g *RandGen) Gas() uint64
- func (g *RandGen) HexStringForNBytes(numBytes int) string
- func (g *RandGen) HexStringForVaryingNBytes(min, sup int) string
- func (g *RandGen) IntRange(start, stop int) int
- func (g *RandGen) L2L1MsgHashes() (hashes []types.FullBytes32)
- func (g *RandGen) LegacyTxRLP() string
- func (g *RandGen) ListOfBytes32(size int) []string
- func (g *RandGen) MsgReceiptConfirmationTx() string
- func (g *RandGen) Nonce() uint64
- func (g *RandGen) PopulateBlockData(pbi *execution.BlockData, prevTimeStamp uint64) (nextTimeStamp uint64)
- func (g *RandGen) PopulateCoordOutput(p *execution.Response)
- func (g *RandGen) PositiveInt(sup int) int
- func (g *RandGen) TxRlp(numTxs int) ([]string, []uint16)
- func (g *RandGen) Value() *big.Int
Constants ¶
View Source
const ( // seed for the RNG SEED_FLAG string = "seed" SEED_USAGE string = "required, integer, seed to use for the RNG" // chain-id CHAIN_ID_FLAG string = "chainid" CHAIN_ID_USAGE string = "required, integer, the chainID of L2" // l2 bridge address L2_MESSAGE_SERVICE_CONTRACT_FLAG string = "l2-bridge-address" L2_MESSAGE_SERVICE_CONTRACT_USAGE string = "l2-bridge-address: required, the 0x prefixed address of the bridge" // time stamp START_FROM_TIMESTAMP_FLAG string = "start-from-timestamp" START_FROM_TIMESTAMP_USAGE string = "required, UNIX-timestamp, timestamp starting which we generate the blocks" // initial root hash START_FROM_ROOT_HASH_FLAG string = "start-from-root-hash" START_FROM_ROOT_HASH_USAGE string = "root upon which we generate a proof" // final root hash END_WITH_ROOT_HASH_FLAG string = "end-with-root-hash" END_WITH_ROOT_HASH_USAGE string = "optional, root hash at which the sequence of blocks should end" // output file OUTPUT_FILE_FLAG string = "ofile" OUTPUT_FILE_USAGE string = "required, path, file where to write the testcase file" // max number of block NUM_BLOCKS_FLAG string = "num-blocks" NUM_BLOCKS_USAGE string = "optional, integer, maximal number of block in the conflated batch" // bound on the number of tx per block MAX_TX_PER_BLOCK_FLAG string = "max-tx-per-block" MAX_TX_PER_BLOCK_USAGE string = "optional, integer, maximal number of tx per block" // bound on the number of l2 msg logs per block // #nosec G101 -- Not a credential MAX_L2L1_LOGS_PER_BLOCKS_FLAG string = "max-l2-l1-logs-per-block" MAX_L2L1_LOGS_PER_BLOCKS_USAGE string = "optional, int, maximal number of l2 msg emitted per block" // bound on the number of msg receipt confirmation MAX_L1L2_MSG_RECEIPT_PER_BLOCK_FLAG string = "max-l1-l2-msg-receipt-per-block" MAX_L1L2_MSG_RECEIPT_PER_BLOCK_USAGE string = "optional, int, maximal number of l1 msg received per block (at most one batch per block)." // min tx size MIN_TX_BYTE_SIZE_FLAG string = "min-tx-byte-size" MIN_TX_BYTE_SIZE_USAGE string = "optional, int, minimal size of an rlp encoded tx" // max-tx-size MAX_TX_BYTE_SIZE_FLAG string = "max-tx-byte-size" MAX_TX_BYTE_SIZE_USAGE string = "optional, int, maximal size of an rlp encoded tx" // calldata-with-zero ZEROES_IN_CALLDATA_FLAG string = "zeroes-in-calldata" ZEROES_IN_CALLDATA_USAGE string = "optional, bool, default to true. If set to true 75pc of the bytes of the calldata of the generated txs is set to zero" // start from block number START_FROM_BLOCK_NUMBER_FLAG string = "start-from-block" START_FROM_BLOCK_NUMBER_USAGE string = "required, integer" )
Variables ¶
This section is empty.
Functions ¶
func EndWithRootHash ¶
func Initialize ¶
func Initialize()
func L2BridgeAddress ¶
func MaxL1L2ReceiptPerBlock ¶
func MaxL1L2ReceiptPerBlock() int
func MaxL2L1LogsPerBlock ¶
func MaxL2L1LogsPerBlock() int
func MaxTxByteSize ¶
func MaxTxByteSize() int
func MaxTxPerBlock ¶
func MaxTxPerBlock() int
func MinTxByteSize ¶
func MinTxByteSize() int
func StartFromBlock ¶
func StartFromBlock() int
func StartFromRootHash ¶
func StartFromRootHash() string
func StartFromTimeStamp ¶
func StartFromTimeStamp() uint64
func ZeroesInCalldata ¶
func ZeroesInCalldata() bool
Types ¶
type RandGen ¶
type RandGen struct { rand.Rand Params struct { SupTxPerBlock int SupL2L1LogsPerBlock int SupMsgReceiptPerBlock int } }
Random number generator
func MakeGeneratorFromCLI ¶
func MakeGeneratorFromCLI() (res RandGen)
Create a generator from the CLI
func (*RandGen) AnyTypeTxRlp ¶
Generates a tx of any type
func (*RandGen) AppendAddress ¶
The input string is an hex encoded string representing a transaction RLP.
func (*RandGen) FromAddresses ¶
func (g *RandGen) FromAddresses(numTxs int) (fromAddresses []types.EthAddress)
Returns a list of addresses with the given size
func (*RandGen) HexStringForNBytes ¶
Returns a random hex string representing n bytes
func (*RandGen) HexStringForVaryingNBytes ¶
Returns an hex string with a varying length in [start, stop)
func (*RandGen) L2L1MsgHashes ¶
func (g *RandGen) L2L1MsgHashes() (hashes []types.FullBytes32)
Generates a list of L2 msg logs
func (*RandGen) ListOfBytes32 ¶
Create the Log hashes
func (*RandGen) MsgReceiptConfirmationTx ¶
Generates an L1 messages batch receipt
func (*RandGen) PopulateBlockData ¶
func (g *RandGen) PopulateBlockData( pbi *execution.BlockData, prevTimeStamp uint64, ) (nextTimeStamp uint64)
Populate the json with random functional inputs
func (*RandGen) PopulateCoordOutput ¶
Populate the json with random data
func (*RandGen) PositiveInt ¶
Returns an non-zero integer in the range
Click to show internal directories.
Click to hide internal directories.