Documentation
¶
Index ¶
- func AnyRequiresERC20(m []Mode) bool
- func AnyRequiresERC721(m []Mode) bool
- func AnyRequiresLoadTestContract(m []Mode) bool
- func HasMode(mode Mode, m []Mode) bool
- func HasUniqueModes(m []Mode) bool
- func RequiresERC20(m Mode) bool
- func RequiresERC721(m Mode) bool
- func RequiresLoadTestContract(m Mode) bool
- type Config
- type Mode
- type UniswapV3Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyRequiresERC20 ¶
AnyRequiresERC20 returns true if any mode requires an ERC20 contract.
func AnyRequiresERC721 ¶
AnyRequiresERC721 returns true if any mode requires an ERC721 contract.
func AnyRequiresLoadTestContract ¶
AnyRequiresLoadTestContract returns true if any mode requires the LoadTester contract.
func HasUniqueModes ¶
HasUniqueModes returns true if all modes in the slice are unique.
func RequiresERC20 ¶
RequiresERC20 returns true if the mode requires an ERC20 contract.
func RequiresERC721 ¶
RequiresERC721 returns true if the mode requires an ERC721 contract.
func RequiresLoadTestContract ¶
RequiresLoadTestContract returns true if the mode requires the LoadTester contract.
Types ¶
type Config ¶
type Config struct {
// Network connection
RPCURL string
ChainID uint64
Proxy string
// Test parameters
Requests int64
Concurrency int64
BatchSize uint64
TimeLimit int64
Seed int64
// Transaction options
PrivateKey string
ToAddress string
EthAmountInWei uint64
RandomRecipients bool
LegacyTxMode bool
FireAndForget bool
WaitForReceipt bool
ReceiptRetryMax uint
ReceiptRetryDelay uint // initial delay in milliseconds
OutputRawTxOnly bool
StartNonce uint64
GasPriceMultiplier float64
// Gas options
ForceGasLimit uint64
ForceGasPrice uint64
ForcePriorityGasPrice uint64
MaxBaseFeeWei uint64
// Rate limiting
RateLimit float64
AdaptiveRateLimit bool
AdaptiveTargetSize uint64
AdaptiveRateLimitIncrement uint64
AdaptiveCycleDuration uint64
AdaptiveBackoffFactor float64
// Mode configuration
Modes []string
// Call-only options
EthCallOnly bool
EthCallOnlyLatestBlock bool
// Contract addresses
LoadTestContractAddress string
ERC20Address string
ERC721Address string
// Mode-specific options
StoreDataSize uint64
RecallLength uint64
BlockBatchSize uint64
ContractAddress string
ContractCallData string
ContractCallPayable bool
BlobFeeCap uint64
// Account pool options
SendingAccountsCount uint64
AccountFundingAmount *big.Int
PreFundSendingAccounts bool
RefundRemainingFunds bool
SendingAccountsFile string
CheckBalanceBeforeFunding bool
// Summary output
ShouldProduceSummary bool
SummaryOutputMode string
// UniswapV3-specific config (set by uniswapv3 subcommand)
UniswapV3 *UniswapV3Config
// Computed fields (populated during initialization)
CurrentGasPrice *big.Int
CurrentGasTipCap *big.Int
CurrentNonce *uint64
ECDSAPrivateKey *ecdsa.PrivateKey
FromETHAddress *common.Address
ToETHAddress *common.Address
ContractETHAddress *common.Address
SendAmount *big.Int
ChainSupportBaseFee bool
ParsedModes []Mode
MultiMode bool
BigGasPriceMultiplier *big.Float
}
Config holds all load test parameters.
type Mode ¶
type Mode int
Mode represents the type of load test to perform.
const ( ModeERC20 Mode = iota ModeERC721 ModeBlob ModeContractCall ModeDeploy ModeIncrement ModeRandom ModeRecall ModeRPC ModeStore ModeTransaction ModeUniswapV3 )
Mode constants. If you add a new constant, run: make gen-load-test-modes
type UniswapV3Config ¶
type UniswapV3Config struct {
// Pre-deployed contract addresses (as hex strings).
FactoryV3 string
Multicall string
ProxyAdmin string
TickLens string
NFTDescriptorLib string
NonfungibleTokenPositionDescriptor string
TransparentUpgradeableProxy string
NonfungiblePositionManager string
Migrator string
Staker string
QuoterV2 string
SwapRouter string
WETH9 string
PoolToken0 string
PoolToken1 string
// Pool and swap parameters.
PoolFees float64
SwapAmountInput uint64
}
UniswapV3Config holds UniswapV3-specific configuration.
func (*UniswapV3Config) Validate ¶
func (c *UniswapV3Config) Validate() error
Validate validates the UniswapV3Config and returns an error if any validation fails.