Skip to content

Commit 9087770

Browse files
authored
Merge pull request #93 from vulcanize/v1.10.4-statediff-0.0.24
Merge v1.10.4-statediff-0.0.24 to v1.10.4-statediff
2 parents 3abcc56 + 0f14f51 commit 9087770

File tree

16 files changed

+393
-80
lines changed

16 files changed

+393
-80
lines changed

.github/workflows/on-master.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Docker Build and publish to Github
33
on:
44
push:
55
branches:
6+
- v1.10.4-statediff
67
- v1.10.3-statediff
78
- v1.10.2-statediff
89
- v1.10.1-statediff

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ require (
3131
github.com/go-stack/stack v1.8.0
3232
github.com/golang/protobuf v1.4.3
3333
github.com/golang/snappy v0.0.3
34+
github.com/google/go-cmp v0.5.4 // indirect
3435
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
3536
github.com/google/uuid v1.1.5
3637
github.com/gorilla/websocket v1.4.2
@@ -61,8 +62,10 @@ require (
6162
github.com/olekukonko/tablewriter v0.0.5
6263
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7
6364
github.com/prometheus/tsdb v0.7.1
65+
github.com/r3labs/diff/v2 v2.13.1 // indirect
6466
github.com/rjeczalik/notify v0.9.1
6567
github.com/rs/cors v1.7.0
68+
github.com/sergi/go-diff v1.2.0 // indirect
6669
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
6770
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4
6871
github.com/stretchr/testify v1.7.0

go.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
398398
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
399399
github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=
400400
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
401+
github.com/r3labs/diff/v2 v2.13.1 h1:o0mlcYwUKTeL6jVblu42vCnXS7gfArPKYJCs4qkwOw8=
402+
github.com/r3labs/diff/v2 v2.13.1/go.mod h1:I8noH9Fc2fjSaMxqF3G2lhDdC0b+JXCfyx85tWFM9kc=
401403
github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc=
402404
github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE=
403405
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
@@ -408,6 +410,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
408410
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
409411
github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
410412
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
413+
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
414+
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
411415
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
412416
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
413417
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
@@ -428,6 +432,7 @@ github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
428432
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
429433
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
430434
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
435+
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
431436
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
432437
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
433438
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 h1:xQdMZ1WLrgkkvOZ/LDQxjVxMLdby7osSh4ZEVa5sIjs=
@@ -440,6 +445,8 @@ github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZF
440445
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4=
441446
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
442447
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
448+
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
449+
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
443450
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
444451
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM=
445452
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
@@ -636,6 +643,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
636643
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
637644
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
638645
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
646+
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
647+
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
639648
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
640649
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
641650
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
VersionMajor = 1 // Major version component of the current release
2525
VersionMinor = 10 // Minor version component of the current release
2626
VersionPatch = 4 // Patch version component of the current release
27-
VersionMeta = "statediff-0.0.23" // Version metadata to append to the version string
27+
VersionMeta = "statediff-0.0.24" // Version metadata to append to the version string
2828
)
2929

3030
// Version holds the textual version string.

statediff/builder_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,9 @@ var (
4040
emptyStorage = make([]sdtypes.StorageNode, 0)
4141
block0, block1, block2, block3, block4, block5, block6 *types.Block
4242
builder statediff.Builder
43-
miningReward = int64(2000000000000000000)
4443
minerAddress = common.HexToAddress("0x0")
4544
minerLeafKey = testhelpers.AddressToLeafKey(minerAddress)
4645

47-
balanceChange10000 = int64(10000)
48-
balanceChange1000 = int64(1000)
49-
block1BankBalance = int64(99990000)
50-
block1Account1Balance = int64(10000)
51-
block2Account2Balance = int64(1000)
52-
5346
slot0 = common.HexToHash("0")
5447
slot1 = common.HexToHash("1")
5548
slot2 = common.HexToHash("2")
@@ -129,7 +122,7 @@ var (
129122

130123
minerAccountAtBlock1, _ = rlp.EncodeToBytes(state.Account{
131124
Nonce: 0,
132-
Balance: big.NewInt(miningReward),
125+
Balance: big.NewInt(2000002625000000000),
133126
CodeHash: testhelpers.NullCodeHash.Bytes(),
134127
Root: testhelpers.EmptyContractRoot,
135128
})
@@ -139,7 +132,7 @@ var (
139132
})
140133
minerAccountAtBlock2, _ = rlp.EncodeToBytes(state.Account{
141134
Nonce: 0,
142-
Balance: big.NewInt(miningReward + miningReward),
135+
Balance: big.NewInt(4000111203461610525),
143136
CodeHash: testhelpers.NullCodeHash.Bytes(),
144137
Root: testhelpers.EmptyContractRoot,
145138
})
@@ -150,7 +143,7 @@ var (
150143

151144
account1AtBlock1, _ = rlp.EncodeToBytes(state.Account{
152145
Nonce: 0,
153-
Balance: big.NewInt(balanceChange10000),
146+
Balance: testhelpers.Block1Account1Balance,
154147
CodeHash: testhelpers.NullCodeHash.Bytes(),
155148
Root: testhelpers.EmptyContractRoot,
156149
})
@@ -160,7 +153,7 @@ var (
160153
})
161154
account1AtBlock2, _ = rlp.EncodeToBytes(state.Account{
162155
Nonce: 2,
163-
Balance: big.NewInt(block1Account1Balance - balanceChange1000 + balanceChange1000),
156+
Balance: big.NewInt(999555797000009000),
164157
CodeHash: testhelpers.NullCodeHash.Bytes(),
165158
Root: testhelpers.EmptyContractRoot,
166159
})
@@ -170,7 +163,7 @@ var (
170163
})
171164
account1AtBlock5, _ = rlp.EncodeToBytes(state.Account{
172165
Nonce: 2,
173-
Balance: big.NewInt(block1Account1Balance - balanceChange1000 + balanceChange1000 + miningReward),
166+
Balance: big.NewInt(2999566008847709960),
174167
CodeHash: testhelpers.NullCodeHash.Bytes(),
175168
Root: testhelpers.EmptyContractRoot,
176169
})
@@ -180,7 +173,7 @@ var (
180173
})
181174
account1AtBlock6, _ = rlp.EncodeToBytes(state.Account{
182175
Nonce: 3,
183-
Balance: big.NewInt(block1Account1Balance - balanceChange1000 + balanceChange1000 + miningReward),
176+
Balance: big.NewInt(2999537516847709960),
184177
CodeHash: testhelpers.NullCodeHash.Bytes(),
185178
Root: testhelpers.EmptyContractRoot,
186179
})
@@ -191,7 +184,7 @@ var (
191184

192185
account2AtBlock2, _ = rlp.EncodeToBytes(state.Account{
193186
Nonce: 0,
194-
Balance: big.NewInt(balanceChange1000),
187+
Balance: big.NewInt(1000),
195188
CodeHash: testhelpers.NullCodeHash.Bytes(),
196189
Root: testhelpers.EmptyContractRoot,
197190
})
@@ -201,7 +194,7 @@ var (
201194
})
202195
account2AtBlock3, _ = rlp.EncodeToBytes(state.Account{
203196
Nonce: 0,
204-
Balance: big.NewInt(block2Account2Balance + miningReward),
197+
Balance: big.NewInt(2000013574009435976),
205198
CodeHash: testhelpers.NullCodeHash.Bytes(),
206199
Root: testhelpers.EmptyContractRoot,
207200
})
@@ -211,7 +204,7 @@ var (
211204
})
212205
account2AtBlock4, _ = rlp.EncodeToBytes(state.Account{
213206
Nonce: 0,
214-
Balance: big.NewInt(block2Account2Balance + miningReward*2),
207+
Balance: big.NewInt(4000048088163070348),
215208
CodeHash: testhelpers.NullCodeHash.Bytes(),
216209
Root: testhelpers.EmptyContractRoot,
217210
})
@@ -221,7 +214,7 @@ var (
221214
})
222215
account2AtBlock6, _ = rlp.EncodeToBytes(state.Account{
223216
Nonce: 0,
224-
Balance: big.NewInt(block2Account2Balance + miningReward*3),
217+
Balance: big.NewInt(6000063293259748636),
225218
CodeHash: testhelpers.NullCodeHash.Bytes(),
226219
Root: testhelpers.EmptyContractRoot,
227220
})
@@ -240,19 +233,23 @@ var (
240233
common.Hex2Bytes("2000bf49f440a1cd0527e4d06e2765654c0f56452257516d793a9b8d604dcfdf2a"),
241234
bankAccountAtBlock0,
242235
})
236+
237+
block1BankBalance = big.NewInt(testhelpers.TestBankFunds.Int64() - testhelpers.BalanceChange10000 - testhelpers.GasFees)
243238
bankAccountAtBlock1, _ = rlp.EncodeToBytes(state.Account{
244239
Nonce: 1,
245-
Balance: big.NewInt(testhelpers.TestBankFunds.Int64() - balanceChange10000),
240+
Balance: block1BankBalance,
246241
CodeHash: testhelpers.NullCodeHash.Bytes(),
247242
Root: testhelpers.EmptyContractRoot,
248243
})
249244
bankAccountAtBlock1LeafNode, _ = rlp.EncodeToBytes([]interface{}{
250245
common.Hex2Bytes("30bf49f440a1cd0527e4d06e2765654c0f56452257516d793a9b8d604dcfdf2a"),
251246
bankAccountAtBlock1,
252247
})
248+
249+
block2BankBalance = block1BankBalance.Int64() - testhelpers.BalanceChange1Ether - testhelpers.GasFees
253250
bankAccountAtBlock2, _ = rlp.EncodeToBytes(state.Account{
254251
Nonce: 2,
255-
Balance: big.NewInt(block1BankBalance - balanceChange1000),
252+
Balance: big.NewInt(block2BankBalance),
256253
CodeHash: testhelpers.NullCodeHash.Bytes(),
257254
Root: testhelpers.EmptyContractRoot,
258255
})
@@ -262,7 +259,7 @@ var (
262259
})
263260
bankAccountAtBlock3, _ = rlp.EncodeToBytes(state.Account{
264261
Nonce: 3,
265-
Balance: big.NewInt(99989000),
262+
Balance: big.NewInt(999914255999990000),
266263
CodeHash: testhelpers.NullCodeHash.Bytes(),
267264
Root: testhelpers.EmptyContractRoot,
268265
})
@@ -272,7 +269,7 @@ var (
272269
})
273270
bankAccountAtBlock4, _ = rlp.EncodeToBytes(state.Account{
274271
Nonce: 6,
275-
Balance: big.NewInt(99989000),
272+
Balance: big.NewInt(999826859999990000),
276273
CodeHash: testhelpers.NullCodeHash.Bytes(),
277274
Root: testhelpers.EmptyContractRoot,
278275
})
@@ -282,7 +279,7 @@ var (
282279
})
283280
bankAccountAtBlock5, _ = rlp.EncodeToBytes(state.Account{
284281
Nonce: 7,
285-
Balance: big.NewInt(99989000),
282+
Balance: big.NewInt(999805027999990000),
286283
CodeHash: testhelpers.NullCodeHash.Bytes(),
287284
Root: testhelpers.EmptyContractRoot,
288285
})
@@ -1706,10 +1703,12 @@ func TestBuilderWithRemovedAccountAndStorageWithoutIntermediateNodes(t *testing.
17061703
if err != nil {
17071704
t.Error(err)
17081705
}
1706+
17091707
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
17101708
if err != nil {
17111709
t.Error(err)
17121710
}
1711+
17131712
sort.Slice(receivedStateDiffRlp, func(i, j int) bool { return receivedStateDiffRlp[i] < receivedStateDiffRlp[j] })
17141713
sort.Slice(expectedStateDiffRlp, func(i, j int) bool { return expectedStateDiffRlp[i] < expectedStateDiffRlp[j] })
17151714
if !bytes.Equal(receivedStateDiffRlp, expectedStateDiffRlp) {
@@ -1740,7 +1739,7 @@ var (
17401739

17411740
bankAccountAtBlock01, _ = rlp.EncodeToBytes(state.Account{
17421741
Nonce: 1,
1743-
Balance: big.NewInt(testhelpers.TestBankFunds.Int64() + miningReward),
1742+
Balance: big.NewInt(3999629697375000000),
17441743
CodeHash: testhelpers.NullCodeHash.Bytes(),
17451744
Root: testhelpers.EmptyContractRoot,
17461745
})
@@ -1750,7 +1749,7 @@ var (
17501749
})
17511750
bankAccountAtBlock02, _ = rlp.EncodeToBytes(state.Account{
17521751
Nonce: 2,
1753-
Balance: big.NewInt(testhelpers.TestBankFunds.Int64() + miningReward*2),
1752+
Balance: big.NewInt(5999607323457344852),
17541753
CodeHash: testhelpers.NullCodeHash.Bytes(),
17551754
Root: testhelpers.EmptyContractRoot,
17561755
})
@@ -1926,6 +1925,7 @@ func TestBuilderWithMovedAccount(t *testing.T) {
19261925
if err != nil {
19271926
t.Error(err)
19281927
}
1928+
19291929
sort.Slice(receivedStateDiffRlp, func(i, j int) bool { return receivedStateDiffRlp[i] < receivedStateDiffRlp[j] })
19301930
sort.Slice(expectedStateDiffRlp, func(i, j int) bool { return expectedStateDiffRlp[i] < expectedStateDiffRlp[j] })
19311931
if !bytes.Equal(receivedStateDiffRlp, expectedStateDiffRlp) {

statediff/db/migrations/00004_create_eth_header_cids_table.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CREATE TABLE eth.header_cids (
1616
bloom BYTEA NOT NULL,
1717
timestamp NUMERIC NOT NULL,
1818
times_validated INTEGER NOT NULL DEFAULT 1,
19+
base_fee BIGINT DEFAULT 0,
1920
UNIQUE (block_number, block_hash)
2021
);
2122

statediff/indexer/indexer.go

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import (
2323
"math/big"
2424
"time"
2525

26-
"github.com/lib/pq"
27-
2826
"github.com/ethereum/go-ethereum/common"
2927
"github.com/ethereum/go-ethereum/core/state"
3028
"github.com/ethereum/go-ethereum/core/types"
@@ -119,7 +117,13 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
119117
return nil, fmt.Errorf("expected number of transactions (%d), transaction trie nodes (%d), receipts (%d), and receipt trie nodes (%d)to be equal", len(txNodes), len(txTrieNodes), len(rctNodes), len(rctTrieNodes))
120118
}
121119
// Calculate reward
122-
reward := CalcEthBlockReward(block.Header(), block.Uncles(), block.Transactions(), receipts)
120+
var reward *big.Int
121+
// in PoA networks block reward is 0
122+
if sdi.chainConfig.Clique != nil {
123+
reward = big.NewInt(0)
124+
} else {
125+
reward = CalcEthBlockReward(block.Header(), block.Uncles(), block.Transactions(), receipts)
126+
}
123127
t = time.Now()
124128
// Begin new db tx for everything
125129
tx, err := sdi.dbWriter.db.Beginx()
@@ -214,6 +218,12 @@ func (sdi *StateDiffIndexer) processHeader(tx *sqlx.Tx, header *types.Header, he
214218
if err := shared.PublishIPLD(tx, headerNode); err != nil {
215219
return 0, fmt.Errorf("error publishing header IPLD: %v", err)
216220
}
221+
222+
var baseFee int64
223+
if header.BaseFee != nil {
224+
baseFee = header.BaseFee.Int64()
225+
}
226+
217227
// index header
218228
return sdi.dbWriter.upsertHeaderCID(tx, models.HeaderModel{
219229
CID: headerNode.Cid().String(),
@@ -229,6 +239,7 @@ func (sdi *StateDiffIndexer) processHeader(tx *sqlx.Tx, header *types.Header, he
229239
TxRoot: header.TxHash.String(),
230240
UncleRoot: header.UncleHash.String(),
231241
Timestamp: header.Time,
242+
BaseFee: baseFee,
232243
})
233244
}
234245

@@ -238,7 +249,13 @@ func (sdi *StateDiffIndexer) processUncles(tx *sqlx.Tx, headerID int64, blockNum
238249
if err := shared.PublishIPLD(tx, uncleNode); err != nil {
239250
return fmt.Errorf("error publishing uncle IPLD: %v", err)
240251
}
241-
uncleReward := CalcUncleMinerReward(blockNumber, uncleNode.Number.Uint64())
252+
var uncleReward *big.Int
253+
// in PoA networks uncle reward is 0
254+
if sdi.chainConfig.Clique != nil {
255+
uncleReward = big.NewInt(0)
256+
} else {
257+
uncleReward = CalcUncleMinerReward(blockNumber, uncleNode.Number.Uint64())
258+
}
242259
uncle := models.UncleModel{
243260
CID: uncleNode.Cid().String(),
244261
MhKey: shared.MultihashKeyFromCID(uncleNode.Cid()),
@@ -334,14 +351,6 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *sqlx.Tx, args processArgs
334351
return err
335352
}
336353

337-
// AccessListEntryModel is the db model for eth.access_list_entry
338-
type AccessListElementModel struct {
339-
ID int64 `db:"id"`
340-
Index int64 `db:"index"`
341-
TxID int64 `db:"tx_id"`
342-
Address string `db:"address"`
343-
StorageKeys pq.StringArray `db:"storage_keys"`
344-
}
345354
// index access list if this is one
346355
for j, accessListElement := range trx.AccessList() {
347356
storageKeys := make([]string, len(accessListElement.StorageKeys))

0 commit comments

Comments
 (0)