Skip to content

Commit e01c338

Browse files
authored
Merge pull request bnb-chain#3094 from bnb-chain/develop
Draft release v1.5.13
2 parents 5735d8a + c4d82c3 commit e01c338

File tree

110 files changed

+6007
-2339
lines changed

Some content is hidden

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

110 files changed

+6007
-2339
lines changed

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
# Changelog
2+
## v1.5.13
3+
### FEATURE
4+
[\#3019](https://github.com/bnb-chain/bsc/pull/3019) BEP-524: Short Block Interval Phase Two: 0.75 seconds
5+
[\#3044](https://github.com/bnb-chain/bsc/pull/3044) params: double FullImmutabilityThreshold for BEP-520 & BEP-524
6+
[\#3045](https://github.com/bnb-chain/bsc/pull/3045) Feature: StakeHub Contract Interface Implementation
7+
[\#3040](https://github.com/bnb-chain/bsc/pull/3040) bsc: add new block fetching mechanism
8+
[\#3043](https://github.com/bnb-chain/bsc/pull/3043) p2p: support new msg broadcast features
9+
[\#3070](https://github.com/bnb-chain/bsc/pull/3070) chore: renaming for evn and some optmization
10+
[\#3073](https://github.com/bnb-chain/bsc/pull/3073) evn: add support for node id removal
11+
[\#3072](https://github.com/bnb-chain/bsc/pull/3072) config: support more evn configuration in tool
12+
[\#3075](https://github.com/bnb-chain/bsc/pull/3075) config: apply two default miner option
13+
[\#3083](https://github.com/bnb-chain/bsc/pull/3083) evn: improve node ID management with better error handling
14+
[\#3084](https://github.com/bnb-chain/bsc/pull/3084) metrics: add more monitor metrics for EVN
15+
[\#3087](https://github.com/bnb-chain/bsc/pull/3087) bsc2: fix block sidecar fetching issue
16+
[\#3090](https://github.com/bnb-chain/bsc/pull/3090) chore: update maxwell contrats addresses
17+
[\#3091](https://github.com/bnb-chain/bsc/pull/3091) chore: fix several occasional issues for EVN
18+
[\#3049](https://github.com/bnb-chain/bsc/pull/3049) upstream: pick bugfix and feature from latest geth v1.5.9
19+
[\#3096](https://github.com/bnb-chain/bsc/pull/3096) config: update BSC Testnet hardfork time: Maxwell
20+
21+
### BUGFIX
22+
[\#3050](https://github.com/bnb-chain/bsc/pull/3050) miner: fix memory leak caused by no discard env
23+
[\#3061](https://github.com/bnb-chain/bsc/pull/3061) p2p: fix bscExt checking logic
24+
25+
### IMPROVEMENT
26+
[\#3034](https://github.com/bnb-chain/bsc/pull/3034) miner: optimize clear up logic for envs
27+
[\#3039](https://github.com/bnb-chain/bsc/pull/3039) Revert "miner: limit block size to eth protocol msg size (#2696)"
28+
[\#3041](https://github.com/bnb-chain/bsc/pull/3041) feat: add json-rpc-api.md
29+
[\#3057](https://github.com/bnb-chain/bsc/pull/3057) eth/protocols/bsc: adjust vote reception limit
30+
[\#3067](https://github.com/bnb-chain/bsc/pull/3067) ethclient/gethclient: add deduplication and max keys limit to GetProof
31+
[\#3063](https://github.com/bnb-chain/bsc/pull/3063) rpc: add method name length limit and configurable message size limit
32+
[\#3077](https://github.com/bnb-chain/bsc/pull/3077) performance: track large tx execution cost
33+
[\#3074](https://github.com/bnb-chain/bsc/pull/3074) jsutils: add tool GetLargeTxs
34+
[\#3082](https://github.com/bnb-chain/bsc/pull/3082) metrics: optimize mev metrics
35+
[\#3081](https://github.com/bnb-chain/bsc/pull/3081) miner: reset recommit timer on new block
36+
[\#3062](https://github.com/bnb-chain/bsc/pull/3062) refactor: use slices.Contains to simplify code
37+
[\#3088](https://github.com/bnb-chain/bsc/pull/3088) core/vote: change waiting blocks for voting since start mining
38+
[\#3089](https://github.com/bnb-chain/bsc/pull/3089) core/systemcontracts: remove lorentz/rialto
39+
[\#3085](https://github.com/bnb-chain/bsc/pull/0000) miner: fix goroutine leak
40+
41+
## v1.5.12
42+
### BUGFIX
43+
[\#3057](https://github.com/bnb-chain/bsc/pull/3057) eth/protocols/bsc: adjust vote reception limit
44+
245
## v1.5.11
346
### FEATURE
447
[\#3008](https://github.com/bnb-chain/bsc/pull/3008) params: add MaxwellTime

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The goal of BNB Smart Chain is to bring programmability and interoperability to BNB Beacon Chain. In order to embrace the existing popular community and advanced technology, it will bring huge benefits by staying compatible with all the existing smart contracts on Ethereum and Ethereum tooling. And to achieve that, the easiest solution is to develop based on go-ethereum fork, as we respect the great work of Ethereum very much.
44

5-
BNB Smart Chain starts its development based on go-ethereum fork. So you may see many toolings, binaries and also docs are based on Ethereum ones, such as the name geth.
5+
BNB Smart Chain starts its development based on go-ethereum fork. So you may see many toolings, binaries and also docs are based on Ethereum ones, such as the name "geth".
66

77
[![API Reference](
88
https://pkg.go.dev/badge/github.com/ethereum/go-ethereum
@@ -194,8 +194,8 @@ $ geth --your-favourite-flags dumpconfig
194194

195195
As a developer, sooner rather than later you'll want to start interacting with `geth` and the
196196
BSC network via your own programs and not manually through the console. To aid
197-
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.github.io/execution-apis/api-documentation/)
198-
and [`geth` specific APIs](https://geth.ethereum.org/docs/interacting-with-geth/rpc)).
197+
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.github.io/execution-apis/api-documentation/),
198+
[`geth` specific APIs](https://geth.ethereum.org/docs/interacting-with-geth/rpc), and [BSC's JSON-RPC API Reference](rpc/json-rpc-api.md)).
199199
These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based
200200
platforms, and named pipes on Windows).
201201

accounts/abi/argument.go

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ func (arguments Arguments) isTuple() bool {
7777
}
7878

7979
// Unpack performs the operation hexdata -> Go format.
80-
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
80+
func (arguments Arguments) Unpack(data []byte) ([]any, error) {
8181
if len(data) == 0 {
8282
if len(arguments.NonIndexed()) != 0 {
8383
return nil, errors.New("abi: attempting to unmarshal an empty string while arguments are expected")
8484
}
85-
return make([]interface{}, 0), nil
85+
return make([]any, 0), nil
8686
}
8787
return arguments.UnpackValues(data)
8888
}
8989

9090
// UnpackIntoMap performs the operation hexdata -> mapping of argument name to argument value.
91-
func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) error {
91+
func (arguments Arguments) UnpackIntoMap(v map[string]any, data []byte) error {
9292
// Make sure map is not nil
9393
if v == nil {
9494
return errors.New("abi: cannot unpack into a nil map")
@@ -110,7 +110,7 @@ func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte)
110110
}
111111

112112
// Copy performs the operation go format -> provided struct.
113-
func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
113+
func (arguments Arguments) Copy(v any, values []any) error {
114114
// make sure the passed value is arguments pointer
115115
if reflect.Ptr != reflect.ValueOf(v).Kind() {
116116
return fmt.Errorf("abi: Unpack(non-pointer %T)", v)
@@ -128,7 +128,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
128128
}
129129

130130
// copyAtomic copies ( hexdata -> go ) a single value
131-
func (arguments Arguments) copyAtomic(v interface{}, marshalledValues interface{}) error {
131+
func (arguments Arguments) copyAtomic(v any, marshalledValues any) error {
132132
dst := reflect.ValueOf(v).Elem()
133133
src := reflect.ValueOf(marshalledValues)
134134

@@ -139,7 +139,7 @@ func (arguments Arguments) copyAtomic(v interface{}, marshalledValues interface{
139139
}
140140

141141
// copyTuple copies a batch of values from marshalledValues to v.
142-
func (arguments Arguments) copyTuple(v interface{}, marshalledValues []interface{}) error {
142+
func (arguments Arguments) copyTuple(v any, marshalledValues []any) error {
143143
value := reflect.ValueOf(v).Elem()
144144
nonIndexedArgs := arguments.NonIndexed()
145145

@@ -181,11 +181,17 @@ func (arguments Arguments) copyTuple(v interface{}, marshalledValues []interface
181181
// UnpackValues can be used to unpack ABI-encoded hexdata according to the ABI-specification,
182182
// without supplying a struct to unpack into. Instead, this method returns a list containing the
183183
// values. An atomic argument will be a list with one element.
184-
func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
185-
nonIndexedArgs := arguments.NonIndexed()
186-
retval := make([]interface{}, 0, len(nonIndexedArgs))
187-
virtualArgs := 0
188-
for index, arg := range nonIndexedArgs {
184+
func (arguments Arguments) UnpackValues(data []byte) ([]any, error) {
185+
var (
186+
retval = make([]any, 0)
187+
virtualArgs = 0
188+
index = 0
189+
)
190+
191+
for _, arg := range arguments {
192+
if arg.Indexed {
193+
continue
194+
}
189195
marshalledValue, err := toGoType((index+virtualArgs)*32, arg.Type, data)
190196
if err != nil {
191197
return nil, err
@@ -208,18 +214,19 @@ func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
208214
virtualArgs += getTypeSize(arg.Type)/32 - 1
209215
}
210216
retval = append(retval, marshalledValue)
217+
index++
211218
}
212219
return retval, nil
213220
}
214221

215222
// PackValues performs the operation Go format -> Hexdata.
216223
// It is the semantic opposite of UnpackValues.
217-
func (arguments Arguments) PackValues(args []interface{}) ([]byte, error) {
224+
func (arguments Arguments) PackValues(args []any) ([]byte, error) {
218225
return arguments.Pack(args...)
219226
}
220227

221228
// Pack performs the operation Go format -> Hexdata.
222-
func (arguments Arguments) Pack(args ...interface{}) ([]byte, error) {
229+
func (arguments Arguments) Pack(args ...any) ([]byte, error) {
223230
// Make sure arguments match up and pack them
224231
abiArgs := arguments
225232
if len(args) != len(abiArgs) {

accounts/abi/bind/base.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,14 @@ func (c *BoundContract) estimateGasLimit(opts *TransactOpts, contract *common.Ad
366366
}
367367
}
368368
msg := ethereum.CallMsg{
369-
From: opts.From,
370-
To: contract,
371-
GasPrice: gasPrice,
372-
GasTipCap: gasTipCap,
373-
GasFeeCap: gasFeeCap,
374-
Value: value,
375-
Data: input,
369+
From: opts.From,
370+
To: contract,
371+
GasPrice: gasPrice,
372+
GasTipCap: gasTipCap,
373+
GasFeeCap: gasFeeCap,
374+
Value: value,
375+
Data: input,
376+
AccessList: opts.AccessList,
376377
}
377378
return c.transactor.EstimateGas(ensureContext(opts.Context), msg)
378379
}

accounts/abi/unpack_test.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,46 @@ import (
3131
"github.com/stretchr/testify/require"
3232
)
3333

34+
func BenchmarkUnpack(b *testing.B) {
35+
testCases := []struct {
36+
def string
37+
packed string
38+
}{
39+
{
40+
def: `[{"type": "uint32"}]`,
41+
packed: "0000000000000000000000000000000000000000000000000000000000000001",
42+
},
43+
{
44+
def: `[{"type": "uint32[]"}]`,
45+
packed: "0000000000000000000000000000000000000000000000000000000000000020" +
46+
"0000000000000000000000000000000000000000000000000000000000000002" +
47+
"0000000000000000000000000000000000000000000000000000000000000001" +
48+
"0000000000000000000000000000000000000000000000000000000000000002",
49+
},
50+
}
51+
for i, test := range testCases {
52+
b.Run(strconv.Itoa(i), func(b *testing.B) {
53+
def := fmt.Sprintf(`[{ "name" : "method", "type": "function", "outputs": %s}]`, test.def)
54+
abi, err := JSON(strings.NewReader(def))
55+
if err != nil {
56+
b.Fatalf("invalid ABI definition %s: %v", def, err)
57+
}
58+
encb, err := hex.DecodeString(test.packed)
59+
if err != nil {
60+
b.Fatalf("invalid hex %s: %v", test.packed, err)
61+
}
62+
63+
b.ResetTimer()
64+
65+
var result any
66+
for range b.N {
67+
result, _ = abi.Unpack("method", encb)
68+
}
69+
_ = result
70+
})
71+
}
72+
}
73+
3474
// TestUnpack tests the general pack/unpack tests in packing_test.go
3575
func TestUnpack(t *testing.T) {
3676
t.Parallel()

0 commit comments

Comments
 (0)