Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
test(repo): change NumConfirmations in tests to 0 (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Apr 2, 2024
1 parent 5f91e0e commit fa99658
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 36 deletions.
2 changes: 1 addition & 1 deletion cmd/flags/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var (
NumConfirmations = &cli.Uint64Flag{
Name: "tx.numConfirmations",
Usage: "Number of confirmations which we will wait after sending a transaction",
Value: 1,
Value: 0,
Category: txmgrCategory,
}
SafeAbortNonceTooLowCount = &cli.Uint64Flag{
Expand Down
16 changes: 0 additions & 16 deletions driver/chain_syncer/beaconsync/progress_tracker_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package beaconsync

import (
"context"
"testing"
"time"

Expand Down Expand Up @@ -50,21 +49,6 @@ func (s *BeaconSyncProgressTrackerTestSuite) TestSyncProgressed() {
s.True(syncProgressed(&ethereum.SyncProgress{HealingBytecode: 0}, &ethereum.SyncProgress{HealingBytecode: 1}))
}

func (s *BeaconSyncProgressTrackerTestSuite) TestTrack() {
// Not triggered
ctx, cancel := context.WithCancel(context.Background())
go s.t.Track(ctx)
time.Sleep(syncProgressCheckInterval + 5*time.Second)
cancel()

// Triggered
ctx, cancel = context.WithCancel(context.Background())
s.t.UpdateMeta(common.Big256, testutils.RandomHash())
go s.t.Track(ctx)
time.Sleep(syncProgressCheckInterval + 5*time.Second)
cancel()
}

func (s *BeaconSyncProgressTrackerTestSuite) TestClearMeta() {
s.t.triggered = true
s.t.ClearMeta()
Expand Down
2 changes: 1 addition & 1 deletion driver/chain_syncer/calldata/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (s *CalldataSyncerTestSuite) initProposer() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
2 changes: 1 addition & 1 deletion driver/chain_syncer/chain_syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *ChainSyncerTestSuite) SetupTest() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
2 changes: 1 addition & 1 deletion driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func (s *DriverTestSuite) InitProposer() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ require (

replace github.com/ethereum/go-ethereum v1.13.14 => github.com/taikoxyz/taiko-geth v0.0.0-20240325051151-061196ff327c

replace github.com/ethereum-optimism/optimism v1.7.0 => github.com/taikoxyz/optimism v0.0.0-20240328025531-2e40f7d36ae4
replace github.com/ethereum-optimism/optimism v1.7.0 => github.com/taikoxyz/optimism v0.0.0-20240402022152-070fc9dba2ec
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,8 @@ github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/taikoxyz/optimism v0.0.0-20240328025531-2e40f7d36ae4 h1:/9evXNu7ZFtiKWG8Xc9F1pgh2wpkDpvTkNmLoBCoSDQ=
github.com/taikoxyz/optimism v0.0.0-20240328025531-2e40f7d36ae4/go.mod h1:X4jEuxN69o7ZVG20Yt3joIOaCDKb1G/dPYVjnR3XxrU=
github.com/taikoxyz/optimism v0.0.0-20240402022152-070fc9dba2ec h1:3CwBNzTe8gl+enXcbsQrbh4RObS/UCWvZ3dtMrdiuEg=
github.com/taikoxyz/optimism v0.0.0-20240402022152-070fc9dba2ec/go.mod h1:X4jEuxN69o7ZVG20Yt3joIOaCDKb1G/dPYVjnR3XxrU=
github.com/taikoxyz/taiko-geth v0.0.0-20240325051151-061196ff327c h1:xrVME9T4Gq4DH9y46/b2JqO1uIWwT4wWISWn9e4WqI4=
github.com/taikoxyz/taiko-geth v0.0.0-20240325051151-061196ff327c/go.mod h1:nqByouVW0a0qx5KKgvYgoXba+pYEHznAAQp6LhZilgM=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
Expand Down
2 changes: 0 additions & 2 deletions internal/docker/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ services:
- "0.0.0.0"
- --hardfork
- cancun
- --block-time
- "1"

l2_execution_engine:
container_name: l2_node
Expand Down
8 changes: 4 additions & 4 deletions pkg/rpc/ethclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ func TestTransactionSender(t *testing.T) {

block, err := client.L1.BlockByNumber(context.Background(), nil)
require.Nil(t, err)
require.Zero(t, block.Transactions().Len())
require.NotZero(t, block.Transactions().Len())
}

func TestTransactionCount(t *testing.T) {
client := newTestClientWithTimeout(t)

block, err := client.L1.BlockByNumber(context.Background(), nil)
require.Nil(t, err)
require.Zero(t, block.Transactions().Len())
require.NotZero(t, block.Transactions().Len())
}

func TestTransactionInBlock(t *testing.T) {
client := newTestClientWithTimeout(t)

block, err := client.L1.BlockByNumber(context.Background(), nil)
require.Nil(t, err)
require.Zero(t, block.Transactions().Len())
require.NotZero(t, block.Transactions().Len())

_, err = client.L1.TransactionInBlock(context.Background(), block.Hash(), 0)
require.NotNil(t, err)
require.Nil(t, err)
}

func TestNetworkID(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *ProposerTestSuite) SetupTest() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
4 changes: 2 additions & 2 deletions prover/proof_submitter/proof_submitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() {
new(metrics.NoopTxMetrics),
txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProverPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
2 changes: 1 addition & 1 deletion prover/proof_submitter/transaction/sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *TransactionTestSuite) SetupTest() {
new(metrics.NoopTxMetrics),
txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProverPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down
6 changes: 3 additions & 3 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (s *ProverTestSuite) SetupTest() {
L1BlockBuilderTip: common.Big0,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProposerPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down Expand Up @@ -141,7 +141,7 @@ func (s *ProverTestSuite) TestInitError() {
BackOffMaxRetrys: 12,
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(l1ProverPrivKey)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down Expand Up @@ -516,7 +516,7 @@ func (s *ProverTestSuite) initProver(
L2NodeVersion: "0.1.0",
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 1,
NumConfirmations: 0,
SafeAbortNonceTooLowCount: txmgr.DefaultBatcherFlagValues.SafeAbortNonceTooLowCount,
PrivateKey: common.Bytes2Hex(crypto.FromECDSA(key)),
FeeLimitMultiplier: txmgr.DefaultBatcherFlagValues.FeeLimitMultiplier,
Expand Down

0 comments on commit fa99658

Please sign in to comment.