Skip to content

Commit 976a34f

Browse files
Merge remote-tracking branch 'origin/master' into filter-submit-retryable
2 parents 0d4147a + 2946369 commit 976a34f

File tree

131 files changed

+5812
-3026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+5812
-3026
lines changed

.github/workflows/_rust-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
- name: Make arbitrator libraries
5353
run: make -j wasm-ci-build
5454

55+
- name: Prepare replay.wasm env
56+
run: make build-replay-env
57+
5558
- name: Clippy check
5659
run: cargo clippy --all -- -D warnings -A static_mut_refs
5760

.github/workflows/automated-changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout Code
1717
uses: actions/checkout@v6
18+
with:
19+
token: ${{ secrets.CHANGELOG_PUSH_TOKEN }}
1820

1921
- name: Create Changelog File
2022
uses: actions/github-script@v8

Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

addressfilter/config.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

arbnode/api.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,75 @@ import (
1010
"github.com/ethereum/go-ethereum/common"
1111
"github.com/ethereum/go-ethereum/common/hexutil"
1212
"github.com/ethereum/go-ethereum/core/rawdb"
13+
"github.com/ethereum/go-ethereum/metrics"
1314

1415
"github.com/offchainlabs/nitro/arbutil"
1516
"github.com/offchainlabs/nitro/staker"
1617
"github.com/offchainlabs/nitro/validator"
1718
"github.com/offchainlabs/nitro/validator/server_api"
1819
)
1920

21+
var (
22+
getL1ConfirmationCallsCounter = metrics.NewRegisteredCounter("arb/consensus_rpc_get_l1_confirmation_calls", nil)
23+
findBatchContainingBlockCallsCounter = metrics.NewRegisteredCounter("arb/consensus_rpc_find_batch_containing_block_calls", nil)
24+
)
25+
2026
type BlockValidatorAPI struct {
2127
val *staker.BlockValidator
2228
}
2329

30+
func NewBlockValidatorAPI(val *staker.BlockValidator) *BlockValidatorAPI {
31+
return &BlockValidatorAPI{
32+
val: val,
33+
}
34+
}
35+
2436
func (a *BlockValidatorAPI) LatestValidated(ctx context.Context) (*staker.GlobalStateValidatedInfo, error) {
2537
return a.val.ReadLastValidatedInfo()
2638
}
2739

40+
type ArbAPI struct {
41+
consensusNode *Node
42+
genesisBlockNum uint64
43+
}
44+
45+
func NewArbAPI(consensusNode *Node, genesisBlockNum uint64) *ArbAPI {
46+
return &ArbAPI{
47+
consensusNode: consensusNode,
48+
genesisBlockNum: genesisBlockNum,
49+
}
50+
}
51+
52+
func (a *ArbAPI) GetL1Confirmations(ctx context.Context, blockNum uint64) (uint64, error) {
53+
getL1ConfirmationCallsCounter.Inc(1)
54+
55+
msgIdx, err := arbutil.BlockNumberToMessageIndex(blockNum, a.genesisBlockNum)
56+
if err != nil {
57+
return 0, err
58+
}
59+
return a.consensusNode.GetL1Confirmations(msgIdx).Await(ctx)
60+
}
61+
62+
func (a *ArbAPI) FindBatchContainingBlock(ctx context.Context, blockNum uint64) (uint64, error) {
63+
findBatchContainingBlockCallsCounter.Inc(1)
64+
65+
msgIdx, err := arbutil.BlockNumberToMessageIndex(blockNum, a.genesisBlockNum)
66+
if err != nil {
67+
return 0, err
68+
}
69+
return a.consensusNode.FindBatchContainingMessage(msgIdx).Await(ctx)
70+
}
71+
2872
type BlockValidatorDebugAPI struct {
2973
val *staker.StatelessBlockValidator
3074
}
3175

76+
func NewBlockValidatorDebugAPI(val *staker.StatelessBlockValidator) *BlockValidatorDebugAPI {
77+
return &BlockValidatorDebugAPI{
78+
val: val,
79+
}
80+
}
81+
3282
type ValidateBlockResult struct {
3383
Valid bool `json:"valid"`
3484
Latency string `json:"latency"`

arbnode/delayed_seq_reorg_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func TestSequencerReorgFromDelayed(t *testing.T) {
2525

2626
err = streamer.Start(ctx)
2727
Require(t, err)
28-
exec.Start(ctx)
28+
err = exec.Start(ctx)
29+
Require(t, err)
2930
init, err := streamer.GetMessage(0)
3031
Require(t, err)
3132

@@ -225,7 +226,8 @@ func TestSequencerReorgFromLastDelayedMsg(t *testing.T) {
225226

226227
err = streamer.Start(ctx)
227228
Require(t, err)
228-
exec.Start(ctx)
229+
err = exec.Start(ctx)
230+
Require(t, err)
229231
init, err := streamer.GetMessage(0)
230232
Require(t, err)
231233

arbnode/delayed_sequencer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var TestDelayedSequencerConfig = DelayedSequencerConfig{
8888
RequireFullFinality: false,
8989
UseMergeFinality: false,
9090
RescanInterval: time.Millisecond * 100,
91-
FilteredTxFullRetryInterval: 30 * time.Second,
91+
FilteredTxFullRetryInterval: 1 * time.Second,
9292
}
9393

9494
func NewDelayedSequencer(l1Reader *headerreader.HeaderReader, reader *InboxReader, exec execution.ExecutionSequencer, coordinator *SeqCoordinator, config DelayedSequencerConfigFetcher) (*DelayedSequencer, error) {

arbnode/inbox_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ func NewTransactionStreamerForTest(t *testing.T, ctx context.Context, ownerAddre
142142
}
143143

144144
transactionStreamerConfigFetcher := func() *TransactionStreamerConfig { return &DefaultTransactionStreamerConfig }
145-
execEngine, err := gethexec.NewExecutionEngine(bc, 0, false)
146-
if err != nil {
147-
Fail(t, err)
148-
}
145+
execEngine := gethexec.NewExecutionEngine(bc, 0, false)
149146
stylusTargetConfig := &gethexec.DefaultStylusTargetConfig
150147
Require(t, stylusTargetConfig.Validate()) // pre-processes config (i.a. parses wasmTargets)
151148
if err := execEngine.Initialize(gethexec.DefaultCachingConfig.StylusLRUCacheCapacity, &gethexec.DefaultStylusTargetConfig); err != nil {
@@ -183,7 +180,8 @@ func TestTransactionStreamer(t *testing.T) {
183180

184181
err := inbox.Start(ctx)
185182
Require(t, err)
186-
exec.Start(ctx)
183+
err = exec.Start(ctx)
184+
Require(t, err)
187185

188186
maxExpectedGasCost := big.NewInt(l2pricing.InitialBaseFeeWei)
189187
maxExpectedGasCost.Mul(maxExpectedGasCost, big.NewInt(2100*2))

arbnode/mel/extraction/batch_lookup.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ func ParseBatchesFromBlock(
6060
return nil, nil, fmt.Errorf("error fetching tx by hash: %v in ParseBatchesFromBlock: %w ", log.TxHash, err)
6161
}
6262

63-
// Record this log for MEL validation. This is a very cheap operation in native mode
64-
// and is optimized for recording mode as well.
65-
if _, err := logsFetcher.LogsForTxIndex(ctx, parentChainHeader.Hash(), log.TxIndex); err != nil {
66-
return nil, nil, fmt.Errorf("error recording relevant logs: %w", err)
67-
}
68-
6963
batch := &mel.SequencerInboxBatch{
7064
BlockHash: log.BlockHash,
7165
ParentChainBlockNumber: log.BlockNumber,

arbnode/mel/extraction/delayed_message_lookup.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ func parseDelayedMessagesFromBlock(
3939
// On Arbitrum One, this is the bridge contract which emits a MessageDelivered event.
4040
if log.Address == melState.DelayedMessagePostingTargetAddress {
4141
relevantLogs = append(relevantLogs, log)
42-
// Record this log for MEL validation. This is a very cheap operation in native mode
43-
// and is optimized for recording mode as well.
44-
if _, err := logsFetcher.LogsForTxIndex(ctx, parentChainHeader.Hash(), log.TxIndex); err != nil {
45-
return nil, fmt.Errorf("error recording relevant logs: %w", err)
46-
}
4742
}
4843
}
4944
if len(relevantLogs) > 0 {
@@ -83,11 +78,6 @@ func parseDelayedMessagesFromBlock(
8378
return nil, err
8479
}
8580
messageData[common.BigToHash(msgNum)] = msg
86-
// Record this log for MEL validation. This is a very cheap operation in native mode
87-
// and is optimized for recording mode as well.
88-
if _, err := logsFetcher.LogsForTxIndex(ctx, parentChainHeader.Hash(), inboxMsgLog.TxIndex); err != nil {
89-
return nil, fmt.Errorf("error recording relevant logs: %w", err)
90-
}
9181
}
9282
for i, parsedLog := range messageDeliveredEvents {
9383
msgKey := common.BigToHash(parsedLog.MessageIndex)

0 commit comments

Comments
 (0)