Skip to content

Commit cd221b5

Browse files
authored
Merge pull request #263 from bnb-chain/develop
chore: prepare for v0.5.2
2 parents 4748aa3 + f3ff1bc commit cd221b5

36 files changed

+462
-58
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
uses: golangci/golangci-lint-action@v3
2424
with:
2525
working-directory: op-node
26-
version: latest
27-
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is"
26+
version: v1.63.4
27+
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 15m -e "errors.As" -e "errors.Is"
2828

2929
op-batcher-lint:
3030
runs-on: ubuntu-latest
@@ -42,8 +42,8 @@ jobs:
4242
uses: golangci/golangci-lint-action@v3
4343
with:
4444
working-directory: op-batcher
45-
version: latest
46-
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is"
45+
version: v1.63.4
46+
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 15m -e "errors.As" -e "errors.Is"
4747

4848
op-proposer-lint:
4949
runs-on: ubuntu-latest
@@ -61,8 +61,8 @@ jobs:
6161
uses: golangci/golangci-lint-action@v3
6262
with:
6363
working-directory: op-proposer
64-
version: latest
65-
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is"
64+
version: v1.63.4
65+
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 15m -e "errors.As" -e "errors.Is"
6666

6767
op-service-lint:
6868
runs-on: ubuntu-latest
@@ -80,8 +80,8 @@ jobs:
8080
uses: golangci/golangci-lint-action@v3
8181
with:
8282
working-directory: op-service
83-
version: latest
84-
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is"
83+
version: v1.63.4
84+
args: -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 15m -e "errors.As" -e "errors.Is"
8585

8686
op-node-test:
8787
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## v0.5.2
4+
5+
This is a minor release and must upgrade to this release before the Pascal & Prague hardforks time of BSC, supports EIP-7702.
6+
7+
- Testnet: Feb-25-2025 06:00 AM +UTC
8+
- Mainnet: Late March.
9+
10+
This release adds a new bootnode in the US region for testnet, improves sequencer recovery functionality, introduces a new engine_opSealPayload API, and updates documentation links.
11+
12+
This release supports EIP-7702, op-node is compatible with type 7702 transactions from L1.
13+
14+
### What's Changed
15+
16+
* chore: add bootnode in us region(testnet) by @krish-nr in https://github.com/bnb-chain/opbnb/pull/249
17+
* feat: handle sequencer recover related logic by @krish-nr in https://github.com/bnb-chain/opbnb/pull/250
18+
* feat: add new engine_opSealPayload API by @bnoieh in https://github.com/bnb-chain/opbnb/pull/248
19+
* doc: update outdated links in readme by @owen-reorg in https://github.com/bnb-chain/opbnb/pull/253
20+
* feat: EIP-7702 adaption by @krish-nr in https://github.com/bnb-chain/opbnb/pull/261
21+
22+
### Docker Images
23+
24+
- ghcr.io/bnb-chain/op-node:v0.5.2
25+
- ghcr.io/bnb-chain/op-batcher:v0.5.2
26+
- ghcr.io/bnb-chain/op-proposer:v0.5.2
27+
28+
**Full Changelog**: https://github.com/bnb-chain/opbnb/compare/v0.5.1...v0.5.2
29+
330
## v0.5.1
431

532
This is a minor release and upgrading is optional.
@@ -262,7 +289,7 @@ https://github.com/bnb-chain/opbnb/compare/v0.3.0...v0.3.1
262289

263290
## v0.3.0
264291

265-
This is a recommended release for op-node. This release brings in upstream updates, see https://github.com/bnb-chain/opbnb/pull/121 for the contents. This is also a ready release for the next planed fork, which will bring in canyon fork from upstream as well.
292+
This is a recommended release for op-node. This release brings in upstream updates, see https://github.com/bnb-chain/opbnb/pull/121 for the contents. This is also a ready release for the next planned fork, which will bring in canyon fork from upstream as well.
266293

267294
### User Facing Changes
268295

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# opBNB - High-performance layer 2 solution
22

3-
The opBNB network is the Layer 2 scaling solution for the BNB Smart Chain(BSC) powered by [bedrock version](https://community.optimism.io/docs/developers/bedrock/) of Optimism OP Stack.
3+
The opBNB network is the Layer 2 scaling solution for the BNB Smart Chain(BSC) powered by bedrock version of [Optimism OP Stack](https://docs.optimism.io/stack/getting-started).
44

55
It works by offloading transaction processing and resource usage from the BNB Smart Chain, while still posting data to the underlying network. Users interact with the opBNB network by depositing funds from BSC and using applications and contracts on opBNB. At its core, opBNB allows users to deposit and withdraw funds, use smart contracts, and view network data with high throughput and low fees. By leveraging Layer 2, opBNB is able to scale beyond the constraints of the BNB Smart Chain and provide an improved experience for users.
66

77
## Comparison
88

9-
Besides the [differentiators of bedrock](https://community.optimism.io/docs/developers/bedrock/differences/), opBNB is the solution that we aim to provide the best optimistic rollup solution on the BSC.
9+
Besides the [differentiators of OP Stack](https://docs.optimism.io/stack/differences), opBNB is the solution that we aim to provide the best optimistic rollup solution on the BSC.
1010

1111
- Capacity can reach to 100m gas per second, which is much higher than other layer 2 solutions on the Ethereum.
1212
- Gas fee of transfer can reach as low as $0.005 on average.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ require (
277277
rsc.io/tmplfunc v0.0.3 // indirect
278278
)
279279

280-
replace github.com/ethereum/go-ethereum v1.13.15 => github.com/bnb-chain/op-geth v1.101315.2-0.0.20240823030609-c0f12a4e1b05
280+
replace github.com/ethereum/go-ethereum v1.13.15 => github.com/bnb-chain/op-geth v1.101315.2-0.0.20250213114253-fbecb252643d
281281

282282
replace github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.0.0
283283

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ github.com/bnb-chain/fastssz v0.1.2 h1:vTcXw5SwCtRYnl/BEclujiml7GXiVOZ74tub4GHpv
184184
github.com/bnb-chain/fastssz v0.1.2/go.mod h1:KcabV+OEw2QwgyY8Fc88ZG79CKYkFdu0kKWyfA3dI6o=
185185
github.com/bnb-chain/greenfield-cometbft v1.0.0 h1:0r6hOJWD/+es0gxP/exKuN/krgXAr3LCn5/XlcgDWr8=
186186
github.com/bnb-chain/greenfield-cometbft v1.0.0/go.mod h1:f35mk/r5ab6yvzlqEWZt68LfUje68sYgMpVlt2CUYMk=
187-
github.com/bnb-chain/op-geth v1.101315.2-0.0.20240823030609-c0f12a4e1b05 h1:Tyov2UCjIxxHt6ZX46T09CiKpKDY72AtjHzUQFK3SBA=
188-
github.com/bnb-chain/op-geth v1.101315.2-0.0.20240823030609-c0f12a4e1b05/go.mod h1:hyHrrcHkUe3lRwfJs+JGrbOHp+pRdheRk+ren4TPhF8=
187+
github.com/bnb-chain/op-geth v1.101315.2-0.0.20250213114253-fbecb252643d h1:zYSisO6VUWaQzieOnP7NcEXfwbcYa86CipNS+sXHb7Q=
188+
github.com/bnb-chain/op-geth v1.101315.2-0.0.20250213114253-fbecb252643d/go.mod h1:hyHrrcHkUe3lRwfJs+JGrbOHp+pRdheRk+ren4TPhF8=
189189
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
190190
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
191191
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=

op-batcher/batcher/driver.go

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package batcher
22

33
import (
4+
"bytes"
45
"context"
56
"errors"
67
"fmt"
@@ -12,6 +13,14 @@ import (
1213
"sync/atomic"
1314
"time"
1415

16+
"github.com/ethereum/go-ethereum/common"
17+
"github.com/ethereum/go-ethereum/common/math"
18+
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
19+
"github.com/ethereum/go-ethereum/core"
20+
"github.com/ethereum/go-ethereum/core/types"
21+
"github.com/ethereum/go-ethereum/log"
22+
"github.com/ethereum/go-ethereum/params"
23+
1524
"github.com/ethereum-optimism/optimism/op-batcher/flags"
1625
"github.com/ethereum-optimism/optimism/op-batcher/metrics"
1726
"github.com/ethereum-optimism/optimism/op-node/rollup"
@@ -20,12 +29,6 @@ import (
2029
"github.com/ethereum-optimism/optimism/op-service/dial"
2130
"github.com/ethereum-optimism/optimism/op-service/eth"
2231
"github.com/ethereum-optimism/optimism/op-service/txmgr"
23-
"github.com/ethereum/go-ethereum/common"
24-
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
25-
"github.com/ethereum/go-ethereum/core"
26-
"github.com/ethereum/go-ethereum/core/types"
27-
"github.com/ethereum/go-ethereum/log"
28-
"github.com/ethereum/go-ethereum/params"
2932
)
3033

3134
const LimitLoadBlocksOneTime uint64 = 30
@@ -678,10 +681,31 @@ func (l *BatchSubmitter) sendTransaction(ctx context.Context, txdata txData, que
678681
candidate = l.calldataTxCandidate(data)
679682
}
680683

681-
intrinsicGas, err := core.IntrinsicGas(candidate.TxData, nil, false, true, true, false)
684+
intrinsicGas, err := core.IntrinsicGas(candidate.TxData, nil, nil, true, true, false, false)
682685
if err != nil {
683686
// we log instead of return an error here because txmgr can do its own gas estimation
684687
l.Log.Error("Failed to calculate intrinsic gas", "err", err)
688+
} else if candidate.Blobs == nil {
689+
minimumGasRequired, err := func(data []byte) (uint64, error) {
690+
var (
691+
z = uint64(bytes.Count(data, []byte{0}))
692+
nz = uint64(len(data)) - z
693+
tokens = nz*params.TxTokenPerNonZeroByte + z
694+
)
695+
if (math.MaxUint64-params.TxGas)/params.TxCostFloorPerToken < tokens {
696+
return 0, errors.New("intrinsic gas too low")
697+
}
698+
return params.TxGas + tokens*params.TxCostFloorPerToken, nil
699+
}(candidate.TxData)
700+
701+
if err != nil {
702+
return err
703+
}
704+
//
705+
baseGas := intrinsicGas - params.TxGas
706+
finalGasLimit := max(baseGas, minimumGasRequired) + params.TxGas
707+
708+
candidate.GasLimit = finalGasLimit
685709
} else {
686710
candidate.GasLimit = intrinsicGas
687711
}

op-chain-ops/cmd/check-derivation/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func getRandomSignedTransaction(ctx context.Context, ethClient *ethclient.Client
225225
var txData types.TxData
226226
switch txType {
227227
case types.LegacyTxType:
228-
gasLimit, err := core.IntrinsicGas(data, nil, false, true, true, false)
228+
gasLimit, err := core.IntrinsicGas(data, nil, nil, false, true, false, false)
229229
if err != nil {
230230
return nil, fmt.Errorf("failed to get intrinsicGas: %w", err)
231231
}
@@ -242,7 +242,7 @@ func getRandomSignedTransaction(ctx context.Context, ethClient *ethclient.Client
242242
Address: randomAddress,
243243
StorageKeys: []common.Hash{common.HexToHash("0x1234")},
244244
}}
245-
gasLimit, err := core.IntrinsicGas(data, accessList, false, true, true, false)
245+
gasLimit, err := core.IntrinsicGas(data, accessList, nil, false, true, false, false)
246246
if err != nil {
247247
return nil, fmt.Errorf("failed to get intrinsicGas: %w", err)
248248
}
@@ -257,7 +257,7 @@ func getRandomSignedTransaction(ctx context.Context, ethClient *ethclient.Client
257257
Data: data,
258258
}
259259
case types.DynamicFeeTxType:
260-
gasLimit, err := core.IntrinsicGas(data, nil, false, true, true, false)
260+
gasLimit, err := core.IntrinsicGas(data, nil, nil, false, true, false, false)
261261
if err != nil {
262262
return nil, fmt.Errorf("failed to get intrinsicGas: %w", err)
263263
}

op-e2e/actions/l2_batcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.Dynamic
277277
opt(rawTx)
278278
}
279279

280-
gas, err := core.IntrinsicGas(rawTx.Data, nil, false, true, true, false)
280+
gas, err := core.IntrinsicGas(rawTx.Data, nil, nil, false, true, false, false)
281281
require.NoError(t, err, "need to compute intrinsic gas")
282282
rawTx.Gas = gas
283283
txData = rawTx
@@ -468,7 +468,7 @@ func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind) {
468468
GasFeeCap: gasFeeCap,
469469
Data: outputFrame,
470470
}
471-
gas, err := core.IntrinsicGas(rawTx.Data, nil, false, true, true, false)
471+
gas, err := core.IntrinsicGas(rawTx.Data, nil, nil, false, true, false, false)
472472
require.NoError(t, err, "need to compute intrinsic gas")
473473
rawTx.Gas = gas
474474

op-e2e/actions/l2_batcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ func BigL2Txs(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
496496
data := make([]byte, 120_000) // very large L2 txs, as large as the tx-pool will accept
497497
_, err := rng.Read(data[:]) // fill with random bytes, to make compression ineffective
498498
require.NoError(t, err)
499-
gas, err := core.IntrinsicGas(data, nil, false, true, true, false)
499+
gas, err := core.IntrinsicGas(data, nil, nil, false, true, true, false)
500500
require.NoError(t, err)
501501
if gas > engine.engineApi.RemainingBlockGas() {
502502
break

op-e2e/actions/l2_verifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type safeDB interface {
7171

7272
func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc derive.L1BlobsFetcher, plasmaSrc driver.PlasmaIface, eng L2API, cfg *rollup.Config, syncCfg *sync.Config, safeHeadListener safeDB) *L2Verifier {
7373
metrics := &testutils.TestDerivationMetrics{}
74-
engine := derive.NewEngineController(eng, log, metrics, cfg, syncCfg)
74+
engine := derive.NewEngineController(eng, log, metrics, cfg, syncCfg, false)
7575

7676
clSync := clsync.NewCLSync(log, cfg, metrics, engine)
7777

0 commit comments

Comments
 (0)