Skip to content

Commit b0c9f4f

Browse files
Merge branch 'master' into consensus-pushes-sync-info
2 parents 8258a39 + 2037191 commit b0c9f4f

Some content is hidden

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

52 files changed

+347
-520
lines changed

.github/workflows/_fast.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: GolangCI Lint
2626
uses: golangci/golangci-lint-action@v8
2727
with:
28-
version: v2.1
28+
version: v2.5
2929

3030
- name: Custom Lint
3131
run: |

.github/workflows/fuzz.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v5
20-
- uses: actions/setup-go@v5
20+
- uses: actions/setup-go@v6
2121
with:
2222
go-version-file: "go.mod"
2323
- id: list
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- uses: actions/checkout@v5
39-
- uses: actions/setup-go@v5
39+
- uses: actions/setup-go@v6
4040
with:
4141
go-version-file: "go.mod"
4242
- uses: shogo82148/actions-go-fuzz/run@v1

.github/workflows/nightly-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,7 @@ jobs:
122122
method: chat.postMessage
123123
token: ${{ secrets.SLACK_BOT_TOKEN }}
124124
payload: |
125-
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
126-
"text": "⚠️ CI job failed! ${RUN_URL}",
125+
{
126+
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
127+
"text": "⚠️ CI job failed! ${{ env.RUN_URL }}",
128+
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ COPY --from=wasm-libs-builder /workspace/ /
7272
FROM wasm-base AS wasm-bin-builder
7373
RUN apt update && apt install -y wabt
7474
# pinned go version
75-
RUN curl -L https://golang.org/dl/go1.24.5.linux-`dpkg --print-architecture`.tar.gz | tar -C /usr/local -xzf -
75+
RUN curl -L https://golang.org/dl/go1.25.1.linux-`dpkg --print-architecture`.tar.gz | tar -C /usr/local -xzf -
7676
COPY ./Makefile ./go.mod ./go.sum ./
7777
COPY ./arbcompress ./arbcompress
7878
COPY ./arbos ./arbos
@@ -245,7 +245,7 @@ RUN ./download-machine.sh consensus-v50-rc.3 0x385fa2524d86d4ebc340988224f8686b3
245245
RUN ./download-machine.sh consensus-v50-rc.4 0x393be710f252e8217d66fe179739eba1ed471f0d5a847b5905c30926d853241a
246246
RUN ./download-machine.sh consensus-v40 0xdb698a2576298f25448bc092e52cf13b1e24141c997135d70f217d674bbeb69a
247247

248-
FROM golang:1.24.5-bookworm AS node-builder
248+
FROM golang:1.25-bookworm AS node-builder
249249
WORKDIR /workspace
250250
ARG version=""
251251
ARG datetime=""

arbnode/mel/extraction/message_extraction_function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func extractMessagesImpl(
100100
if state.ParentChainBlockHash != parentChainHeader.ParentHash {
101101
return nil, nil, nil, fmt.Errorf(
102102
"parent chain block hash in MEL state does not match incoming block's parent hash: expected %s, got %s",
103-
state.ParentChainPreviousBlockHash.Hex(),
103+
state.ParentChainBlockHash.Hex(),
104104
parentChainHeader.ParentHash.Hex(),
105105
)
106106
}

arbnode/transaction_streamer.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,17 +1063,19 @@ func (s *TransactionStreamer) WriteMessageFromSequencer(
10631063
if s.insertionMutex.TryLock() {
10641064
return true
10651065
}
1066-
lockTick := time.Tick(5 * time.Millisecond)
1067-
lockTimeout := time.After(50 * time.Millisecond)
1066+
lockTicker := time.NewTicker(5 * time.Millisecond)
1067+
defer lockTicker.Stop()
1068+
lockTimeout := time.NewTimer(50 * time.Millisecond)
1069+
defer lockTimeout.Stop()
10681070
for {
10691071
select {
1070-
case <-lockTimeout:
1072+
case <-lockTimeout.C:
10711073
return false
10721074
default:
10731075
select {
1074-
case <-lockTimeout:
1076+
case <-lockTimeout.C:
10751077
return false
1076-
case <-lockTick:
1078+
case <-lockTicker.C:
10771079
if s.insertionMutex.TryLock() {
10781080
return true
10791081
}

arbos/arbosState/arbosstate.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"github.com/offchainlabs/nitro/arbos/storage"
3535
"github.com/offchainlabs/nitro/arbos/util"
3636
"github.com/offchainlabs/nitro/cmd/chaininfo"
37-
"github.com/offchainlabs/nitro/util/arbmath"
3837
"github.com/offchainlabs/nitro/util/testhelpers/env"
3938
)
4039

@@ -392,10 +391,6 @@ func (state *ArbosState) UpgradeArbosVersion(
392391
ensure(p.UpgradeToArbosVersion(nextArbosVersion))
393392
ensure(p.Save())
394393
ensure(state.l2PricingState.SetMaxPerTxGasLimit(l2pricing.InitialPerTxGasLimitV50))
395-
oldBlockGasLimit, err := state.l2PricingState.PerBlockGasLimit()
396-
ensure(err)
397-
newBlockGasLimit := arbmath.SaturatingUMul(oldBlockGasLimit, 4)
398-
ensure(state.l2PricingState.SetMaxPerBlockGasLimit(newBlockGasLimit))
399394
default:
400395
return fmt.Errorf(
401396
"the chain is upgrading to unsupported ArbOS version %v, %w",

arbos/block_processor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var ArbRetryableTxAddress common.Address
3232
var ArbSysAddress common.Address
3333
var InternalTxStartBlockMethodID [4]byte
3434
var InternalTxBatchPostingReportMethodID [4]byte
35+
var InternalTxBatchPostingReportV2MethodID [4]byte
3536
var RedeemScheduledEventID common.Hash
3637
var L2ToL1TransactionEventID common.Hash
3738
var L2ToL1TxEventID common.Hash
@@ -186,7 +187,8 @@ func ProduceBlock(
186187
exposeMultiGas bool,
187188
) (*types.Block, types.Receipts, error) {
188189
chainConfig := chainContext.Config()
189-
txes, err := ParseL2Transactions(message, chainConfig.ChainID)
190+
lastArbosVersion := types.DeserializeHeaderExtraInformation(lastBlockHeader).ArbOSFormatVersion
191+
txes, err := ParseL2Transactions(message, chainConfig.ChainID, lastArbosVersion)
190192
if err != nil {
191193
log.Warn("error parsing incoming message", "err", err)
192194
txes = types.Transactions{}

arbos/incomingmessage_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"testing"
1010

1111
"github.com/ethereum/go-ethereum/common"
12+
"github.com/ethereum/go-ethereum/params"
1213

1314
"github.com/offchainlabs/nitro/arbos/arbostypes"
1415
)
@@ -38,7 +39,7 @@ func TestSerializeAndParseL1Message(t *testing.T) {
3839
if err != nil {
3940
t.Error(err)
4041
}
41-
txes, err := ParseL2Transactions(newMsg, chainId)
42+
txes, err := ParseL2Transactions(newMsg, chainId, params.MaxDebugArbosVersionSupported)
4243
if err != nil {
4344
t.Error(err)
4445
}

arbos/internal_tx.go

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,48 @@ func ApplyInternalTxUpdate(tx *types.ArbitrumInternalTx, state *arbosState.Arbos
117117
}
118118
batchTimestamp := util.SafeMapGet[*big.Int](inputs, "batchTimestamp")
119119
batchPosterAddress := util.SafeMapGet[common.Address](inputs, "batchPosterAddress")
120+
batchDataGas := util.SafeMapGet[uint64](inputs, "batchDataGas")
121+
l1BaseFeeWei := util.SafeMapGet[*big.Int](inputs, "l1BaseFeeWei")
122+
123+
l1p := state.L1PricingState()
124+
perBatchGas, err := l1p.PerBatchGasCost()
125+
if err != nil {
126+
log.Warn("L1Pricing PerBatchGas failed", "err", err)
127+
}
128+
gasSpent := arbmath.SaturatingAdd(perBatchGas, arbmath.SaturatingCast[int64](batchDataGas))
129+
weiSpent := arbmath.BigMulByUint(l1BaseFeeWei, arbmath.SaturatingUCast[uint64](gasSpent))
130+
err = l1p.UpdateForBatchPosterSpending(
131+
evm.StateDB,
132+
evm,
133+
state.ArbOSVersion(),
134+
batchTimestamp.Uint64(),
135+
evm.Context.Time,
136+
batchPosterAddress,
137+
weiSpent,
138+
l1BaseFeeWei,
139+
util.TracingDuringEVM,
140+
)
141+
if err != nil {
142+
log.Warn("L1Pricing UpdateForSequencerSpending failed", "err", err)
143+
}
144+
return nil
145+
case InternalTxBatchPostingReportV2MethodID:
146+
inputs, err := util.UnpackInternalTxDataBatchPostingReportV2(tx.Data)
147+
if err != nil {
148+
return err
149+
}
150+
batchTimestamp := util.SafeMapGet[*big.Int](inputs, "batchTimestamp")
151+
batchPosterAddress := util.SafeMapGet[common.Address](inputs, "batchPosterAddress")
120152
batchCalldataLength := util.SafeMapGet[uint64](inputs, "batchCalldataLength")
121153
batchCalldataNonZeros := util.SafeMapGet[uint64](inputs, "batchCalldataNonZeros")
122-
batchLegacyGas := util.SafeMapGet[uint64](inputs, "batchLegacyGas")
123154
batchExtraGas := util.SafeMapGet[uint64](inputs, "batchExtraGas")
124155
l1BaseFeeWei := util.SafeMapGet[*big.Int](inputs, "l1BaseFeeWei")
125156

126-
var gasSpent uint64
127-
if batchCalldataLength == ^uint64(0) {
128-
if state.ArbOSVersion() >= params.ArbosVersion_50 {
129-
return fmt.Errorf("missing batch calldata stats for arbos >= 50")
130-
}
131-
gasSpent = batchLegacyGas
132-
} else {
133-
gasSpent = arbostypes.LegacyCostForStats(&arbostypes.BatchDataStats{
134-
Length: batchCalldataLength,
135-
NonZeros: batchCalldataNonZeros,
136-
})
137-
if batchLegacyGas != ^uint64(0) && batchLegacyGas != gasSpent {
138-
log.Error("legacy gas doesn't fit local compute", "local", gasSpent, "legacy", batchLegacyGas, "timestamp", batchTimestamp)
139-
}
140-
}
157+
gasSpent := arbostypes.LegacyCostForStats(&arbostypes.BatchDataStats{
158+
Length: batchCalldataLength,
159+
NonZeros: batchCalldataNonZeros,
160+
})
161+
141162
gasSpent = arbmath.SaturatingUAdd(gasSpent, batchExtraGas)
142163

143164
l1p := state.L1PricingState()
@@ -172,9 +193,10 @@ func ApplyInternalTxUpdate(tx *types.ArbitrumInternalTx, state *arbosState.Arbos
172193
util.TracingDuringEVM,
173194
)
174195
if err != nil {
175-
log.Warn("L1Pricing UpdateForSequencerSpending failed", "err", err)
196+
log.Warn("L1Pricing UpdateForSequencerSpending failed (v2 report)", "err", err)
176197
}
177198
return nil
199+
178200
default:
179201
return fmt.Errorf("unknown internal tx method selector: %v", hex.EncodeToString(tx.Data[:4]))
180202
}

0 commit comments

Comments
 (0)