Skip to content

Commit d013ac5

Browse files
authored
Merge branch 'master' into ci-shellcheck
2 parents d4e0cb9 + 840876a commit d013ac5

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

+794
-727
lines changed

accounts/abi/bind/backends/simulated.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.Genesis
115115
Alloc: alloc,
116116
}
117117
cacheConfig := &core.CacheConfig{}
118-
blockchain, err := core.NewBlockChain(database, cacheConfig, &genesis, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
119-
if err != nil {
120-
panic(fmt.Sprintf("failed to create simulated blockchain: %v", err))
121-
}
118+
blockchain, _ := core.NewBlockChain(database, cacheConfig, &genesis, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
119+
122120
backend := &SimulatedBackend{
123121
database: database,
124122
blockchain: blockchain,
@@ -610,6 +608,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call interfaces.Call
610608
for lo+1 < hi {
611609
mid := (hi + lo) / 2
612610
failed, _, err := executable(mid)
611+
613612
// If the error is not nil(consensus error), it means the provided message
614613
// call or transaction will never be accepted no matter how much gas it is
615614
// assigned. Return the error directly, don't struggle any more

accounts/abi/bind/bind_test.go

Lines changed: 75 additions & 61 deletions
Large diffs are not rendered by default.

consensus/dummy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The dummy consensus engine is responsible for performing verification on the hea
1414

1515
Subnet-EVM includes a dynamic fee algorithm based off of (EIP-1559)[https://eips.ethereum.org/EIPS/eip-1559]. This introduces a field to the block type called `BaseFee`. The Base Fee sets a minimum gas price for any transaction to be included in the block. For example, a transaction with a gas price of 49 gwei, will be invalid to include in a block with a base fee of 50 gwei.
1616

17-
The dynamic fee algorithm aims to adjust the base fee to handle network congestion. Subnet-EVM sets a target utilization on the network, and the dynamic fee algorithm adjusts the base fee accordingly. If the network operates above the target utilization, the dynamic fee algorithm will increase the base fee to make utilizing he network more expensive and bring overall utilization down. If the network operates below the target utilization, the dynamic fee algorithm will decrease the base fee to make it cheaper to use the network.
17+
The dynamic fee algorithm aims to adjust the base fee to handle network congestion. Subnet-EVM sets a target utilization on the network, and the dynamic fee algorithm adjusts the base fee accordingly. If the network operates above the target utilization, the dynamic fee algorithm will increase the base fee to make utilizing the network more expensive and bring overall utilization down. If the network operates below the target utilization, the dynamic fee algorithm will decrease the base fee to make it cheaper to use the network.
1818

1919
- EIP-1559 is intended for Ethereum where a block is produced roughly every 10s
2020
- The dynamic fee algorithm needs to handle the case that the network quiesces and there are no blocks for a long period of time

contracts/package-lock.json

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

contracts/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@avalabs/subnet-evm-contracts",
33
"devDependencies": {
4-
"@types/chai": "^4.3.5",
5-
"@types/mocha": "^9.0.0",
6-
"chai": "^4.3.7",
7-
"prettier": "^2.5.1",
8-
"prettier-plugin-solidity": "^1.1.3"
4+
"@types/chai": "^4.3.11",
5+
"@types/mocha": "^9.1.1",
6+
"chai": "^4.4.1",
7+
"prettier": "^3.2.4",
8+
"prettier-plugin-solidity": "^1.3.1"
99
},
10-
"version": "1.1.0",
10+
"version": "1.2.0",
1111
"description": "",
1212
"main": "dist/index.js",
1313
"types": "dist/index.d.ts",
@@ -30,13 +30,13 @@
3030
"dependencies": {
3131
"@nomiclabs/hardhat-ethers": "^2.2.3",
3232
"@nomiclabs/hardhat-waffle": "^2.0.6",
33-
"@types/node": "^16.7.1",
33+
"@types/node": "^16.11.7",
3434
"@avalabs/avalanchejs": "^3.17.0",
35-
"ethers": "^5.4.5",
36-
"hardhat": "2.17.1",
37-
"ts-node": "^10.9.1",
38-
"typescript": "^5.1.6",
39-
"@openzeppelin/contracts": "^4.9.3",
35+
"ethers": "^5.7.2",
36+
"hardhat": "2.19.4",
37+
"ts-node": "^10.9.2",
38+
"typescript": "^5.3.3",
39+
"@openzeppelin/contracts": "^4.9.5",
4040
"ds-test": "https://github.com/dapphub/ds-test.git"
4141
},
4242
"engines": {

core/bench_test.go

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"testing"
3333

3434
"github.com/ava-labs/subnet-evm/consensus/dummy"
35-
"github.com/ava-labs/subnet-evm/constants"
3635
"github.com/ava-labs/subnet-evm/core/rawdb"
3736
"github.com/ava-labs/subnet-evm/core/types"
3837
"github.com/ava-labs/subnet-evm/core/vm"
@@ -46,39 +45,31 @@ import (
4645
func BenchmarkInsertChain_empty_memdb(b *testing.B) {
4746
benchInsertChain(b, false, nil)
4847
}
49-
5048
func BenchmarkInsertChain_empty_diskdb(b *testing.B) {
5149
benchInsertChain(b, true, nil)
5250
}
53-
5451
func BenchmarkInsertChain_valueTx_memdb(b *testing.B) {
5552
benchInsertChain(b, false, genValueTx(0))
5653
}
57-
5854
func BenchmarkInsertChain_valueTx_diskdb(b *testing.B) {
5955
benchInsertChain(b, true, genValueTx(0))
6056
}
61-
6257
func BenchmarkInsertChain_valueTx_100kB_memdb(b *testing.B) {
6358
benchInsertChain(b, false, genValueTx(100*1024))
6459
}
65-
6660
func BenchmarkInsertChain_valueTx_100kB_diskdb(b *testing.B) {
6761
benchInsertChain(b, true, genValueTx(100*1024))
6862
}
6963

7064
func BenchmarkInsertChain_ring200_memdb(b *testing.B) {
7165
benchInsertChain(b, false, genTxRing(200))
7266
}
73-
7467
func BenchmarkInsertChain_ring200_diskdb(b *testing.B) {
7568
benchInsertChain(b, true, genTxRing(200))
7669
}
77-
7870
func BenchmarkInsertChain_ring1000_memdb(b *testing.B) {
7971
benchInsertChain(b, false, genTxRing(1000))
8072
}
81-
8273
func BenchmarkInsertChain_ring1000_diskdb(b *testing.B) {
8374
benchInsertChain(b, true, genTxRing(1000))
8475
}
@@ -187,47 +178,36 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) {
187178
func BenchmarkChainRead_header_10k(b *testing.B) {
188179
benchReadChain(b, false, 10000)
189180
}
190-
191181
func BenchmarkChainRead_full_10k(b *testing.B) {
192182
benchReadChain(b, true, 10000)
193183
}
194-
195184
func BenchmarkChainRead_header_100k(b *testing.B) {
196185
benchReadChain(b, false, 100000)
197186
}
198-
199187
func BenchmarkChainRead_full_100k(b *testing.B) {
200188
benchReadChain(b, true, 100000)
201189
}
202-
203190
func BenchmarkChainRead_header_500k(b *testing.B) {
204191
benchReadChain(b, false, 500000)
205192
}
206-
207193
func BenchmarkChainRead_full_500k(b *testing.B) {
208194
benchReadChain(b, true, 500000)
209195
}
210-
211196
func BenchmarkChainWrite_header_10k(b *testing.B) {
212197
benchWriteChain(b, false, 10000)
213198
}
214-
215199
func BenchmarkChainWrite_full_10k(b *testing.B) {
216200
benchWriteChain(b, true, 10000)
217201
}
218-
219202
func BenchmarkChainWrite_header_100k(b *testing.B) {
220203
benchWriteChain(b, false, 100000)
221204
}
222-
223205
func BenchmarkChainWrite_full_100k(b *testing.B) {
224206
benchWriteChain(b, true, 100000)
225207
}
226-
227208
func BenchmarkChainWrite_header_500k(b *testing.B) {
228209
benchWriteChain(b, false, 500000)
229210
}
230-
231211
func BenchmarkChainWrite_full_500k(b *testing.B) {
232212
benchWriteChain(b, true, 500000)
233213
}
@@ -238,7 +218,7 @@ func makeChainForBench(db ethdb.Database, full bool, count uint64) {
238218
var hash common.Hash
239219
for n := uint64(0); n < count; n++ {
240220
header := &types.Header{
241-
Coinbase: constants.BlackholeAddr,
221+
Coinbase: common.Address{},
242222
Number: big.NewInt(int64(n)),
243223
ParentHash: hash,
244224
Difficulty: big.NewInt(1),

core/fifo_cache.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
package core
55

6-
import (
7-
"sync"
8-
)
6+
import "sync"
97

108
var (
119
_ FIFOCache[int, int] = (*BufferFIFOCache[int, int])(nil)

core/genesis.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ func SetupGenesisBlock(
183183
if genesis.Config == nil {
184184
return nil, common.Hash{}, errGenesisNoConfig
185185
}
186-
187186
// Just commit the new block if there is no stored genesis block.
188187
stored := rawdb.ReadCanonicalHash(db, 0)
189188
if (stored == common.Hash{}) {

core/rawdb/chain_iterator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestChainIterator(t *testing.T) {
7575
WriteCanonicalHash(chainDb, block.Hash(), block.NumberU64())
7676
}
7777

78-
cases := []struct {
78+
var cases = []struct {
7979
from, to uint64
8080
reverse bool
8181
expect []int

core/state/pruner/pruner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ const warningLog = `
434434
435435
WARNING!
436436
437-
The clean trie cache is not found. Please delete it by yourself after the
437+
The clean trie cache is not found. Please delete it by yourself after the
438438
pruning. Remember don't start the Subnet-EVM without deleting the clean trie cache
439439
otherwise the entire database may be damaged!
440440

0 commit comments

Comments
 (0)