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

test(proposer): change tests to send blob transactions #799

Merged
merged 7 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/docker/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
- "8545"
entrypoint:
- anvil
- --chain-id
- "32301"
- --host
- "0.0.0.0"
- --hardfork
Expand Down
19 changes: 3 additions & 16 deletions proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"testing"
"time"

"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
Expand Down Expand Up @@ -87,6 +86,8 @@
MaxTierFeePriceBumps: 3,
ExtraData: "test",
L1BlockBuilderTip: common.Big0,
BlobAllowed: true,
ProposeBlockTxGasLimit: 10000000,
YoGhurt111 marked this conversation as resolved.
Show resolved Hide resolved
TxmgrConfigs: &txmgr.CLIConfig{
L1RPCURL: os.Getenv("L1_NODE_WS_ENDPOINT"),
NumConfirmations: 0,
Expand All @@ -108,7 +109,7 @@
s.cancel = cancel
}

func parseTxs(client *rpc.Client, event *bindings.TaikoL1ClientBlockProposed) (types.Transactions, error) {

Check failure on line 112 in proposer/proposer_test.go

View workflow job for this annotation

GitHub Actions / Lint

func `parseTxs` is unused (unused)
tx, err := client.L1.TransactionInBlock(context.Background(), event.Raw.BlockHash, event.Raw.TxIndex)
if err != nil {
return nil, err
Expand Down Expand Up @@ -178,26 +179,19 @@
}

// trigger the error
candidate.Blobs = []*eth.Blob{}
candidate.GasLimit = 10000000

txCandidates[i] = *candidate
}

var errors []error
for _, txCandidate := range txCandidates {
receipt, err := p.txmgr.Send(ctx, txCandidate)
s.Nil(err)
errors = append(errors, encoding.TryParsingCustomErrorFromReceipt(ctx, p.rpc.L1, p.proposerAddress, receipt))
}

// confirm errors handled
for _, err := range errors {
s.Equal("L1_BLOB_NOT_AVAILABLE", err.Error())
s.Nil(encoding.TryParsingCustomErrorFromReceipt(ctx, p.rpc.L1, p.proposerAddress, receipt))
}
}

func (s *ProposerTestSuite) getLatestProposedTxs(

Check failure on line 194 in proposer/proposer_test.go

View workflow job for this annotation

GitHub Actions / Lint

func `(*ProposerTestSuite).getLatestProposedTxs` is unused (unused)
n int,
timeout time.Duration,
) (<-chan []types.Transactions, error) {
Expand Down Expand Up @@ -260,9 +254,6 @@
s.Nil(err)
s.Equal(true, len(preBuiltTxList) > 0)

txsCh, err := s.getLatestProposedTxs(len(preBuiltTxList), time.Minute)
s.Nil(err)

var (
blockMinGasLimit uint64 = math.MaxUint64
blockMinTxListBytes uint64 = math.MaxUint64
Expand All @@ -279,7 +270,7 @@
} else {
break
}
txLists = append(txLists, txs.TxList)

Check failure on line 273 in proposer/proposer_test.go

View workflow job for this annotation

GitHub Actions / Lint

SA4010: this result of append is never used, except maybe in other appends (staticcheck)
}

// Start proposer
Expand All @@ -290,11 +281,7 @@
p.MinProposingInternal = time.Minute
s.Nil(p.ProposeOp(context.Background()))

txs := <-txsCh
for i := 0; i < len(txLists); i++ {
s.Equal(txLists[i].Len(), txs[i].Len())
}
}

Check failure on line 284 in proposer/proposer_test.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary trailing newline (whitespace)

func (s *ProposerTestSuite) TestName() {
s.Equal("proposer", s.p.Name())
Expand Down
2 changes: 1 addition & 1 deletion proposer/transaction_builder/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *TransactionBuilderTestSuite) SetupTest() {
common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")),
common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
common.HexToAddress(os.Getenv("ASSIGNMENT_HOOK_ADDRESS")),
0,
10000000,
davidtaikocha marked this conversation as resolved.
Show resolved Hide resolved
"test",
)
}
Expand Down
Loading