Skip to content

Commit ac353af

Browse files
manav24010xsharmapratikspatil024cfflsDaniil
authored
Merge master to qa (ethereum#813)
* Merge qa to master (ethereum#750) * Added checks to RPC requests and introduced new flags to customise the parameters (ethereum#657) * added a check to reject rpc requests with batch size > the one set using a newly added flag (rpcbatchlimit) * added a check to reject rpc requests whose result size > the one set using a newly added flag (rpcreturndatalimit) * updated the config files and docs * chg : trieTimeout from 60 to 10 mins (ethereum#692) * chg : trieTimeout from 60 to 10 mins * chg : cache.timout to 10m from 1h in configs * internal/cli/server : fix : added triesInMemory in config (ethereum#691) * changed version from 0.3.0 to 0.3.4-beta (ethereum#693) * fix nil state-sync issue, increase grpc limit (ethereum#695) * Increase grpc message size limit in pprof * consensus/bor/bor.go : stateSyncs init fixed [Fix ethereum#686] * eth/filters: handle nil state-sync before notify * eth/filters: update check Co-authored-by: Jerry <[email protected]> Co-authored-by: Daniil <[email protected]> * core, tests/bor: add more tests for state-sync validation (ethereum#710) * core: add get state sync function for tests * tests/bor: add validation for state sync events post consensus * Arpit/temp bor sync (ethereum#701) * Increase grpc message size limit in pprof * ReadBorReceipts improvements * use internal function * fix tests * fetch geth upstread for ReadBorReceiptRLP * Only query bor receipt when the query index is equal to # tx in block body This change reduces the frequency of calling ReadBorReceipt and ReadBorTransaction, which are CPU and db intensive. * Revert "fetch geth upstread for ReadBorReceiptRLP" This reverts commit 2e838a6b1313d26674f3a8df4b044e35dcbf35a0. * Restore ReadBorReceiptRLP * fix bor receipts * remove unused * fix lints --------- Co-authored-by: Jerry <[email protected]> Co-authored-by: Manav Darji <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> * Revert "chg : trieTimeout from 60 to 10 mins (ethereum#692)" (ethereum#720) This reverts commit 241843c. * Arpit/add execution pool 2 (ethereum#719) * initial * linters * linters * remove timeout * update pool * change pool size function * check nil * check nil * fix tests * Use execution pool from server in all handlers * simplify things * test fix * add support for cli, config * add to cli and config * merge base branch * debug statements * fix bug * atomic pointer timeout * add apis * update workerpool * fix issues * change params * fix issues * fix ipc issue * remove execution pool from IPC * revert * fix tests * mutex * refactor flag and value names * ordering fix * refactor flag and value names * update default ep size to 40 * fix bor start issues * revert file changes * debug statements * fix bug * update workerpool * atomic pointer timeout * add apis * Merge branch 'add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * fix issues * change params * fix issues * fix ipc issue * remove execution pool from IPC * revert * merge base branch * Merge branch 'add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * mutex * fix tests * Merge branch 'arpit/add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * Change default size of execution pool to 40 * refactor flag and value names * fix merge conflicts * ordering fix * refactor flag and value names * update default ep size to 40 * fix bor start issues * revert file changes * fix linters * fix go.mod * change sec to ms * change default value for ep timeout * fix node api calls * comment setter for ep timeout --------- Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Manav Darji <[email protected]> * version change (ethereum#721) * Event based pprof (ethereum#732) * feature * Save pprof to /tmp --------- Co-authored-by: Jerry <[email protected]> * Cherry-pick changes from develop (ethereum#738) * Check if block is nil to prevent panic (ethereum#736) * miner: use env for tracing instead of block object (ethereum#728) --------- Co-authored-by: Dmitry <[email protected]> * add max code init size check in txpool (ethereum#739) * Revert "Event based pprof" and update version (ethereum#742) * Revert "Event based pprof (ethereum#732)" This reverts commit 22fa403. * params: update version to 0.3.4-beta3 * packaging/templates: update bor version * params, packaging/templates: update bor version --------- Co-authored-by: SHIVAM SHARMA <[email protected]> Co-authored-by: Pratik Patil <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Daniil <[email protected]> Co-authored-by: Arpit Temani <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: Dmitry <[email protected]> * core, miner: add sub-spans for tracing (ethereum#753) * core, miner: add sub-spans for tracing * fix linters * core: add logs for debugging * core: add more logs to print tdd while reorg * fix linters * core: minor fix * core: remove debug logs * core: use different span for write block and set head * core: use internal context for sending traces (ethereum#755) * core: add : impossible reorg block dump (ethereum#754) * add : impossible reorg block dump * chg : 3 seperate files for impossoble reorg dump * add : use exportBlocks method and RLP blocks before writing * chg : small changes * bump : go version from 1.19 to 1.20.1 (ethereum#761) * Revert "bump : go version from 1.19 to 1.20.1 (ethereum#761)" This reverts commit 4561012. * core/vm: use optimized bigint (ethereum#26021) * Add holiman/big * Fix linter * Bump version to v0.3.5 * fix lints from develop (few lints decided to appear from code that was untouched, weird) * upgrade crypto lib version (ethereum#770) * bump dep : github.com/Masterminds/goutils to v1.1.1 (ethereum#769) * mardizzone/pos-1313: bump crypto dependency (ethereum#772) * dev: chg: bumd net dependency * dev: chg: bump crypto dependency * dev: chg: bump crypto dependency * bump dep : golang.org/x/net to v0.8.0 (ethereum#771) * Verify validator set against local contract on receiving an end-of-sprint block (ethereum#768) * Verify validator set against local contract on receiving an end-of-sprint block * Fix tests * Respect error returned by ParseValidators * Keep going back until a parent block presents * core/txpool: implement DoS defenses from geth (ethereum#778) * Hotfixes and deps bump (ethereum#776) * dev: chg: bump deps * internal/cli/server, rpc: lower down http readtimeout to 10s * dev: chg: get p2p adapter * dev: chg: lower down jsonrpc readtimeout to 10s * cherry-pick txpool optimisation changes * add check for empty lists in txpool (ethereum#704) * add check * linters * core, miner: add empty instrumentation name for tracing --------- Co-authored-by: Raneet Debnath <[email protected]> Co-authored-by: SHIVAM SHARMA <[email protected]> Co-authored-by: Evgeny Danilenko <[email protected]> Co-authored-by: Manav Darji <[email protected]> * packaging,params: bump to v0.3.6 (ethereum#782) * v0.3.6 fix (ethereum#787) * Fix get validator set in header verifier * chg : commit tx logs from info to debug (ethereum#673) * chg : commit tx logs from info to debug * fix : minor changes * chg : miner : commitTransactions-stats moved from info to debug * lint : fix linters * refactor logging * miner : chg : UnauthorizedSignerError to debug * lint : fix lint * fix : log.Logger interface compatibility --------- Co-authored-by: Evgeny Danienko <[email protected]> * Remove unnecessary sorting of valset from header in verification * dev: chg: version bump --------- Co-authored-by: SHIVAM SHARMA <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: marcello33 <[email protected]> * core: improve locks in txpool (ethereum#807) * added a write lock to the txs.filter method and a read lock to the txs.reheap method - both of which are called by Filter during reorg adjustments to txpool * txpool reorg locks * more locks * locks * linters * params, packaging: update version for v0.3.8-beta release * core: add logs in reheap --------- Co-authored-by: Alex <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> * Merge qa to master (ethereum#808) * Added checks to RPC requests and introduced new flags to customise the parameters (ethereum#657) * added a check to reject rpc requests with batch size > the one set using a newly added flag (rpcbatchlimit) * added a check to reject rpc requests whose result size > the one set using a newly added flag (rpcreturndatalimit) * updated the config files and docs * chg : trieTimeout from 60 to 10 mins (ethereum#692) * chg : trieTimeout from 60 to 10 mins * chg : cache.timout to 10m from 1h in configs * internal/cli/server : fix : added triesInMemory in config (ethereum#691) * changed version from 0.3.0 to 0.3.4-beta (ethereum#693) * fix nil state-sync issue, increase grpc limit (ethereum#695) * Increase grpc message size limit in pprof * consensus/bor/bor.go : stateSyncs init fixed [Fix ethereum#686] * eth/filters: handle nil state-sync before notify * eth/filters: update check Co-authored-by: Jerry <[email protected]> Co-authored-by: Daniil <[email protected]> * core, tests/bor: add more tests for state-sync validation (ethereum#710) * core: add get state sync function for tests * tests/bor: add validation for state sync events post consensus * Arpit/temp bor sync (ethereum#701) * Increase grpc message size limit in pprof * ReadBorReceipts improvements * use internal function * fix tests * fetch geth upstread for ReadBorReceiptRLP * Only query bor receipt when the query index is equal to # tx in block body This change reduces the frequency of calling ReadBorReceipt and ReadBorTransaction, which are CPU and db intensive. * Revert "fetch geth upstread for ReadBorReceiptRLP" This reverts commit 2e838a6b1313d26674f3a8df4b044e35dcbf35a0. * Restore ReadBorReceiptRLP * fix bor receipts * remove unused * fix lints --------- Co-authored-by: Jerry <[email protected]> Co-authored-by: Manav Darji <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> * Revert "chg : trieTimeout from 60 to 10 mins (ethereum#692)" (ethereum#720) This reverts commit 241843c. * Arpit/add execution pool 2 (ethereum#719) * initial * linters * linters * remove timeout * update pool * change pool size function * check nil * check nil * fix tests * Use execution pool from server in all handlers * simplify things * test fix * add support for cli, config * add to cli and config * merge base branch * debug statements * fix bug * atomic pointer timeout * add apis * update workerpool * fix issues * change params * fix issues * fix ipc issue * remove execution pool from IPC * revert * fix tests * mutex * refactor flag and value names * ordering fix * refactor flag and value names * update default ep size to 40 * fix bor start issues * revert file changes * debug statements * fix bug * update workerpool * atomic pointer timeout * add apis * Merge branch 'add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * fix issues * change params * fix issues * fix ipc issue * remove execution pool from IPC * revert * merge base branch * Merge branch 'add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * mutex * fix tests * Merge branch 'arpit/add-execution-pool' of github.com:maticnetwork/bor into arpit/add-execution-pool * Change default size of execution pool to 40 * refactor flag and value names * fix merge conflicts * ordering fix * refactor flag and value names * update default ep size to 40 * fix bor start issues * revert file changes * fix linters * fix go.mod * change sec to ms * change default value for ep timeout * fix node api calls * comment setter for ep timeout --------- Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Manav Darji <[email protected]> * version change (ethereum#721) * Event based pprof (ethereum#732) * feature * Save pprof to /tmp --------- Co-authored-by: Jerry <[email protected]> * Cherry-pick changes from develop (ethereum#738) * Check if block is nil to prevent panic (ethereum#736) * miner: use env for tracing instead of block object (ethereum#728) --------- Co-authored-by: Dmitry <[email protected]> * add max code init size check in txpool (ethereum#739) * Revert "Event based pprof" and update version (ethereum#742) * Revert "Event based pprof (ethereum#732)" This reverts commit 22fa403. * params: update version to 0.3.4-beta3 * packaging/templates: update bor version * internal/ethapi :: Fix : newRPCTransactionFromBlockIndex * fix: remove assignment for bor receipt --------- Co-authored-by: SHIVAM SHARMA <[email protected]> Co-authored-by: Pratik Patil <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Daniil <[email protected]> Co-authored-by: Arpit Temani <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: Dmitry <[email protected]> * Setting up bor to use hosted 18.04 runner as ubuntu provided 18.04 runner is end of life --------- Co-authored-by: SHIVAM SHARMA <[email protected]> Co-authored-by: Pratik Patil <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Daniil <[email protected]> Co-authored-by: Arpit Temani <[email protected]> Co-authored-by: Evgeny Danienko <[email protected]> Co-authored-by: Dmitry <[email protected]> Co-authored-by: Martin Holst Swende <[email protected]> Co-authored-by: marcello33 <[email protected]> Co-authored-by: Raneet Debnath <[email protected]> Co-authored-by: Raneet Debnath <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Daniel Jones <[email protected]>
1 parent a853701 commit ac353af

Some content is hidden

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

69 files changed

+4269
-622
lines changed

.github/workflows/packager.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-18.04
15+
runs-on:
16+
group: ubuntu-runners
17+
labels: 18.04RunnerT2Large
1618
steps:
1719
- name: Checkout
1820
uses: actions/checkout@v2

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ ios:
5959
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
6060

6161
test:
62-
$(GOTEST) --timeout 5m -shuffle=on -cover -coverprofile=cover.out $(TESTALL)
62+
$(GOTEST) --timeout 5m -shuffle=on -cover -short -coverprofile=cover.out -covermode=atomic $(TESTALL)
63+
64+
test-txpool-race:
65+
$(GOTEST) -run=TestPoolMiningDataRaces --timeout 600m -race -v ./core/
6366

6467
test-race:
6568
$(GOTEST) --timeout 15m -race -shuffle=on $(TESTALL)
@@ -75,7 +78,7 @@ lint:
7578

7679
lintci-deps:
7780
rm -f ./build/bin/golangci-lint
78-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.48.0
81+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.50.1
7982

8083
goimports:
8184
goimports -local "$(PACKAGE)" -w .

builder/files/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ syncmode = "full"
9494
# vhosts = ["*"]
9595
# corsdomain = ["*"]
9696
# [jsonrpc.timeouts]
97-
# read = "30s"
97+
# read = "10s"
9898
# write = "30s"
9999
# idle = "2m0s"
100100

cmd/evm/internal/t8ntool/transaction.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
"os"
2525
"strings"
2626

27+
"gopkg.in/urfave/cli.v1"
28+
2729
"github.com/ethereum/go-ethereum/common"
2830
"github.com/ethereum/go-ethereum/common/hexutil"
2931
"github.com/ethereum/go-ethereum/core"
@@ -32,7 +34,6 @@ import (
3234
"github.com/ethereum/go-ethereum/params"
3335
"github.com/ethereum/go-ethereum/rlp"
3436
"github.com/ethereum/go-ethereum/tests"
35-
"gopkg.in/urfave/cli.v1"
3637
)
3738

3839
type result struct {

common/debug/debug.go

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

33
import (
4+
"fmt"
45
"runtime"
56
)
67

@@ -26,3 +27,26 @@ func Callers(show int) []string {
2627

2728
return callers
2829
}
30+
31+
func CodeLine() (string, string, int) {
32+
pc, filename, line, _ := runtime.Caller(1)
33+
return runtime.FuncForPC(pc).Name(), filename, line
34+
}
35+
36+
func CodeLineStr() string {
37+
pc, filename, line, _ := runtime.Caller(1)
38+
return fmt.Sprintf("%s:%d - %s", filename, line, runtime.FuncForPC(pc).Name())
39+
}
40+
41+
func Stack(all bool) []byte {
42+
buf := make([]byte, 4096)
43+
44+
for {
45+
n := runtime.Stack(buf, all)
46+
if n < len(buf) {
47+
return buf[:n]
48+
}
49+
50+
buf = make([]byte, 2*len(buf))
51+
}
52+
}

common/math/big.go

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ package math
2020
import (
2121
"fmt"
2222
"math/big"
23+
24+
"github.com/holiman/uint256"
2325
)
2426

2527
// Various big integer limit values.
@@ -132,6 +134,7 @@ func MustParseBig256(s string) *big.Int {
132134
// BigPow returns a ** b as a big integer.
133135
func BigPow(a, b int64) *big.Int {
134136
r := big.NewInt(a)
137+
135138
return r.Exp(r, big.NewInt(b), nil)
136139
}
137140

@@ -140,6 +143,15 @@ func BigMax(x, y *big.Int) *big.Int {
140143
if x.Cmp(y) < 0 {
141144
return y
142145
}
146+
147+
return x
148+
}
149+
150+
func BigMaxUint(x, y *uint256.Int) *uint256.Int {
151+
if x.Lt(y) {
152+
return y
153+
}
154+
143155
return x
144156
}
145157

@@ -148,6 +160,15 @@ func BigMin(x, y *big.Int) *big.Int {
148160
if x.Cmp(y) > 0 {
149161
return y
150162
}
163+
164+
return x
165+
}
166+
167+
func BigMinUint256(x, y *uint256.Int) *uint256.Int {
168+
if x.Gt(y) {
169+
return y
170+
}
171+
151172
return x
152173
}
153174

@@ -227,10 +248,10 @@ func U256Bytes(n *big.Int) []byte {
227248
// S256 interprets x as a two's complement number.
228249
// x must not exceed 256 bits (the result is undefined if it does) and is not modified.
229250
//
230-
// S256(0) = 0
231-
// S256(1) = 1
232-
// S256(2**255) = -2**255
233-
// S256(2**256-1) = -1
251+
// S256(0) = 0
252+
// S256(1) = 1
253+
// S256(2**255) = -2**255
254+
// S256(2**256-1) = -1
234255
func S256(x *big.Int) *big.Int {
235256
if x.Cmp(tt255) < 0 {
236257
return x

common/math/uint.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package math
2+
3+
import (
4+
"math/big"
5+
6+
"github.com/holiman/uint256"
7+
)
8+
9+
var (
10+
U0 = uint256.NewInt(0)
11+
U1 = uint256.NewInt(1)
12+
U100 = uint256.NewInt(100)
13+
)
14+
15+
func U256LTE(a, b *uint256.Int) bool {
16+
return a.Lt(b) || a.Eq(b)
17+
}
18+
19+
func FromBig(v *big.Int) *uint256.Int {
20+
u, _ := uint256.FromBig(v)
21+
22+
return u
23+
}

common/time.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package common
2+
3+
import "time"
4+
5+
const TimeMilliseconds = "15:04:05.000"
6+
7+
func NowMilliseconds() string {
8+
return time.Now().Format(TimeMilliseconds)
9+
}

common/tracing/context.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"time"
66

7+
"go.opentelemetry.io/otel"
78
"go.opentelemetry.io/otel/attribute"
89
"go.opentelemetry.io/otel/trace"
910
)
@@ -51,11 +52,16 @@ func Trace(ctx context.Context, spanName string) (context.Context, trace.Span) {
5152
return tr.Start(ctx, spanName)
5253
}
5354

54-
func Exec(ctx context.Context, spanName string, opts ...Option) {
55+
func Exec(ctx context.Context, instrumentationName, spanName string, opts ...Option) {
5556
var span trace.Span
5657

5758
tr := FromContext(ctx)
5859

60+
if tr == nil && len(instrumentationName) != 0 {
61+
tr = otel.GetTracerProvider().Tracer(instrumentationName)
62+
ctx = WithTracer(ctx, tr)
63+
}
64+
5965
if tr != nil {
6066
ctx, span = tr.Start(ctx, spanName)
6167
}
@@ -85,7 +91,7 @@ func ElapsedTime(ctx context.Context, span trace.Span, msg string, fn func(conte
8591
fn(ctx, span)
8692

8793
if span != nil {
88-
span.SetAttributes(attribute.Int(msg, int(time.Since(now).Milliseconds())))
94+
span.SetAttributes(attribute.Int(msg, int(time.Since(now).Microseconds())))
8995
}
9096
}
9197

consensus/bor/bor.go

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,14 @@ func (c *Bor) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Head
298298
return c.verifyHeader(chain, header, nil)
299299
}
300300

301+
func (c *Bor) GetSpanner() Spanner {
302+
return c.spanner
303+
}
304+
305+
func (c *Bor) SetSpanner(spanner Spanner) {
306+
c.spanner = spanner
307+
}
308+
301309
// VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers. The
302310
// method returns a quit channel to abort the operations and a results channel to
303311
// retrieve the async verifications (the order is that of the input slice).
@@ -454,6 +462,33 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t
454462
return err
455463
}
456464

465+
// Verify the validator list match the local contract
466+
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
467+
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber), number+1)
468+
469+
if err != nil {
470+
return err
471+
}
472+
473+
sort.Sort(valset.ValidatorsByAddress(newValidators))
474+
475+
headerVals, err := valset.ParseValidators(header.Extra[extraVanity : len(header.Extra)-extraSeal])
476+
477+
if err != nil {
478+
return err
479+
}
480+
481+
if len(newValidators) != len(headerVals) {
482+
return errInvalidSpanValidators
483+
}
484+
485+
for i, val := range newValidators {
486+
if !bytes.Equal(val.HeaderBytes(), headerVals[i].HeaderBytes()) {
487+
return errInvalidSpanValidators
488+
}
489+
}
490+
}
491+
457492
// verify the validator list in the last sprint block
458493
if IsSprintStart(number, c.config.CalculateSprint(number)) {
459494
parentValidatorBytes := parent.Extra[extraVanity : len(parent.Extra)-extraSeal]
@@ -518,7 +553,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
518553
hash := checkpoint.Hash()
519554

520555
// get validators and current span
521-
validators, err := c.spanner.GetCurrentValidators(context.Background(), hash, number+1)
556+
validators, err := c.spanner.GetCurrentValidatorsByHash(context.Background(), hash, number+1)
522557
if err != nil {
523558
return nil, err
524559
}
@@ -688,7 +723,7 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e
688723

689724
// get validator set if number
690725
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
691-
newValidators, err := c.spanner.GetCurrentValidators(context.Background(), header.ParentHash, number+1)
726+
newValidators, err := c.spanner.GetCurrentValidatorsByHash(context.Background(), header.ParentHash, number+1)
692727
if err != nil {
693728
return errUnknownValidators
694729
}
@@ -821,7 +856,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
821856
if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
822857
cx := statefull.ChainContext{Chain: chain, Bor: c}
823858

824-
tracing.Exec(finalizeCtx, "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
859+
tracing.Exec(finalizeCtx, "", "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
825860
// check and commit span
826861
err = c.checkAndCommitSpan(finalizeCtx, state, header, cx)
827862
})
@@ -832,7 +867,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
832867
}
833868

834869
if c.HeimdallClient != nil {
835-
tracing.Exec(finalizeCtx, "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
870+
tracing.Exec(finalizeCtx, "", "bor.checkAndCommitSpan", func(ctx context.Context, span trace.Span) {
836871
// commit states
837872
stateSyncData, err = c.CommitStates(finalizeCtx, state, header, cx)
838873
})
@@ -844,7 +879,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
844879
}
845880
}
846881

847-
tracing.Exec(finalizeCtx, "bor.changeContractCodeIfNeeded", func(ctx context.Context, span trace.Span) {
882+
tracing.Exec(finalizeCtx, "", "bor.changeContractCodeIfNeeded", func(ctx context.Context, span trace.Span) {
848883
err = c.changeContractCodeIfNeeded(headerNumber, state)
849884
})
850885

@@ -854,7 +889,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
854889
}
855890

856891
// No block rewards in PoA, so the state remains as it is
857-
tracing.Exec(finalizeCtx, "bor.IntermediateRoot", func(ctx context.Context, span trace.Span) {
892+
tracing.Exec(finalizeCtx, "", "bor.IntermediateRoot", func(ctx context.Context, span trace.Span) {
858893
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
859894
})
860895

@@ -1218,7 +1253,7 @@ func (c *Bor) SetHeimdallClient(h IHeimdallClient) {
12181253
}
12191254

12201255
func (c *Bor) GetCurrentValidators(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error) {
1221-
return c.spanner.GetCurrentValidators(ctx, headerHash, blockNumber)
1256+
return c.spanner.GetCurrentValidatorsByHash(ctx, headerHash, blockNumber)
12221257
}
12231258

12241259
//

0 commit comments

Comments
 (0)