diff --git a/cmd/simulator/load/funder.go b/cmd/simulator/load/funder.go index 4fbb2308a1..bd5015bbbc 100644 --- a/cmd/simulator/load/funder.go +++ b/cmd/simulator/load/funder.go @@ -109,7 +109,7 @@ func DistributeFunds(ctx context.Context, client ethclient.Client, keys []*key.K return nil, fmt.Errorf("failed to generate fund distribution sequence from %s of length %d", maxFundsKey.Address, len(needFundsAddrs)) } worker := NewSingleAddressTxWorker(ctx, client, maxFundsKey.Address) - txFunderAgent := txs.NewIssueNAgent[txs.TimedTx](txSequence, worker, numTxs) + txFunderAgent := txs.NewIssueNAgent[*types.Transaction](txSequence, worker, numTxs) reg := prometheus.NewRegistry() m := metrics.NewMetrics(reg) diff --git a/cmd/simulator/load/loader.go b/cmd/simulator/load/loader.go index 259a3b74df..f54ce4c99a 100644 --- a/cmd/simulator/load/loader.go +++ b/cmd/simulator/load/loader.go @@ -116,7 +116,7 @@ func ExecuteLoader(ctx context.Context, config config.Config) error { log.Info("Constructing tx agents...", "numAgents", config.Workers) agents := make([]txs.Agent[*types.Transaction], 0, config.Workers) for i := 0; i < config.Workers; i++ { - agents = append(agents, txs.NewIssueNAgent[txs.TimedTx](txSequences[i], NewSingleAddressTxWorker(ctx, clients[i], senders[i]), config.BatchSize)) + agents = append(agents, txs.NewIssueNAgent[*types.Transaction](txSequences[i], NewSingleAddressTxWorker(ctx, clients[i], senders[i]), config.BatchSize)) } reg := prometheus.NewRegistry() diff --git a/cmd/simulator/load/worker.go b/cmd/simulator/load/worker.go index 911645f013..9d3063354e 100644 --- a/cmd/simulator/load/worker.go +++ b/cmd/simulator/load/worker.go @@ -8,7 +8,6 @@ import ( "fmt" "time" - "github.com/ava-labs/subnet-evm/cmd/simulator/txs" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/ethclient" "github.com/ava-labs/subnet-evm/interfaces" @@ -45,8 +44,8 @@ func NewSingleAddressTxWorker(ctx context.Context, client ethclient.Client, addr return tw } -func (tw *singleAddressTxWorker) IssueTx(ctx context.Context, timedTx txs.TimedTx) error { - err := tw.client.SendTransaction(ctx, timedTx.Tx) +func (tw *singleAddressTxWorker) IssueTx(ctx context.Context, tx *types.Transaction) error { + err := tw.client.SendTransaction(ctx, tx) if err != nil { return err } @@ -54,8 +53,7 @@ func (tw *singleAddressTxWorker) IssueTx(ctx context.Context, timedTx txs.TimedT return nil } -func (tw *singleAddressTxWorker) ConfirmTx(ctx context.Context, timedTx txs.TimedTx) error { - tx := timedTx.Tx +func (tw *singleAddressTxWorker) ConfirmTx(ctx context.Context, tx *types.Transaction) error { txNonce := tx.Nonce() for { diff --git a/cmd/simulator/txs/tx_generator.go b/cmd/simulator/txs/tx_generator.go index 53c8afa36b..d2c98ba151 100644 --- a/cmd/simulator/txs/tx_generator.go +++ b/cmd/simulator/txs/tx_generator.go @@ -18,7 +18,7 @@ var _ TxSequence[*types.Transaction] = (*txSequence)(nil) type CreateTx func(key *ecdsa.PrivateKey, nonce uint64) (*types.Transaction, error) // GenerateTxSequence fetches the current nonce of key and calls [generator] [numTxs] times sequentially to generate a sequence of transactions. -func GenerateTxSequence(ctx context.Context, generator CreateTx, client ethclient.Client, key *ecdsa.PrivateKey, numTxs uint64) (TxSequence[TimedTx], error) { +func GenerateTxSequence(ctx context.Context, generator CreateTx, client ethclient.Client, key *ecdsa.PrivateKey, numTxs uint64) (TxSequence[*types.Transaction], error) { address := ethcrypto.PubkeyToAddress(key.PublicKey) startingNonce, err := client.NonceAt(ctx, address, nil) if err != nil { @@ -36,7 +36,7 @@ func GenerateTxSequence(ctx context.Context, generator CreateTx, client ethclien return ConvertTxSliceToSequence(txs), nil } -func GenerateTxSequences(ctx context.Context, generator CreateTx, client ethclient.Client, keys []*ecdsa.PrivateKey, txsPerKey uint64) ([]TxSequence[TimedTx], error) { +func GenerateTxSequences(ctx context.Context, generator CreateTx, client ethclient.Client, keys []*ecdsa.PrivateKey, txsPerKey uint64) ([]TxSequence[*types.Transaction], error) { txSequences := make([]TxSequence[*types.Transaction], len(keys)) for i, key := range keys { txs, err := GenerateTxSequence(ctx, generator, client, key, txsPerKey) diff --git a/scripts/run_simulator.sh b/scripts/run_simulator.sh index 7d24d63d5b..d1fb6c4c41 100755 --- a/scripts/run_simulator.sh +++ b/scripts/run_simulator.sh @@ -36,9 +36,7 @@ run_simulator() { --timeout=30s \ --workers=1 \ --max-fee-cap=300 \ - --max-tip-cap=100 \ - --blockchain-id-str=$BLOCKCHAIN_ID \ - --metrics-endpoints=$METRICS_ENDPOINTS + --max-tip-cap=100 } run_simulator