Skip to content

Commit

Permalink
feat: add input load test parameter flag for blob fee cap
Browse files Browse the repository at this point in the history
Signed-off-by: Ji Hwan <jkim@polygon.technology>
  • Loading branch information
jhkimqd committed Jun 4, 2024
1 parent 4d301bd commit cc00b0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/loadtest/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type (
ContractCallFunctionArgs *[]string
ContractCallPayable *bool
InscriptionContent *string
BlobFeeCap *uint64

// Computed
CurrentGasPrice *big.Int
Expand Down Expand Up @@ -229,6 +230,7 @@ func initFlags() {
ltp.SummaryOutputMode = LoadtestCmd.PersistentFlags().String("output-mode", "text", "Format mode for summary output (json | text)")
ltp.LegacyTransactionMode = LoadtestCmd.PersistentFlags().Bool("legacy", false, "Send a legacy transaction instead of an EIP1559 transaction.")
ltp.SendOnly = LoadtestCmd.PersistentFlags().Bool("send-only", false, "Send transactions and load without waiting for it to be mined.")
ltp.BlobFeeCap = LoadtestCmd.Flags().Uint64("blob-fee-cap", 100000, "The blob fee cap, or the maximum blob fee per chunk, in Gwei.")

// Local flags.
ltp.Modes = LoadtestCmd.Flags().StringSliceP("mode", "m", []string{"t"}, `The testing mode to use. It can be multiple like: "t,c,d,f"
Expand Down
5 changes: 3 additions & 2 deletions cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1501,15 +1501,16 @@ func loadTestBlob(ctx context.Context, c *ethclient.Client, nonce uint64) (t1 ti

gasLimit := uint64(21000)
gasPrice, gasTipCap := getSuggestedGasPrices(ctx, c)
blobFeeCap := uint64(1000000000) // 1eth
// blobFeeCap := uint64(1000000000) // 1eth
blobFeeCap := ltp.BlobFeeCap

// Initialize blobTx with blob transaction type
blobTx := ethtypes.BlobTx{
ChainID: uint256.NewInt(chainID.Uint64()),
Nonce: nonce,
GasTipCap: uint256.NewInt(gasTipCap.Uint64()),
GasFeeCap: uint256.NewInt(gasPrice.Uint64()),
BlobFeeCap: uint256.NewInt(blobFeeCap),
BlobFeeCap: uint256.NewInt(*blobFeeCap),
Gas: gasLimit,
To: *to,
Value: uint256.NewInt(amount.Uint64()),
Expand Down

0 comments on commit cc00b0a

Please sign in to comment.