mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
merge develop
This commit is contained in:
commit
3d8ee19c4c
23 changed files with 1674 additions and 331 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
|
@ -107,6 +107,11 @@ jobs:
|
|||
- name: Test
|
||||
run: make test
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: unitTest-coverage
|
||||
path: cover.out
|
||||
|
||||
#- name: Data race tests
|
||||
# run: make test-race
|
||||
|
||||
|
|
@ -153,17 +158,25 @@ jobs:
|
|||
- name: test-integration
|
||||
run: make test-integration
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: integrationTest-coverage
|
||||
path: cover.out
|
||||
|
||||
codecov:
|
||||
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [unit-tests, integration-tests]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
file: ./cover.out
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
e2e-tests:
|
||||
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
|
||||
|
|
|
|||
41
.github/workflows/codeql.yml
vendored
Normal file
41
.github/workflows/codeql.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "develop" ]
|
||||
pull_request:
|
||||
branches: [ "master", "develop" ]
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'go' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
name: Security CI
|
||||
name: Govuln
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
|
|
@ -8,12 +8,12 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Running govulncheck
|
||||
uses: Templum/govulncheck-action@v0.10.1
|
||||
uses: Templum/govulncheck-action@v1.0.0
|
||||
continue-on-error: true
|
||||
env:
|
||||
DEBUG: "true"
|
||||
with:
|
||||
go-version: 1.20.5
|
||||
go-version: 1.21
|
||||
package: ./...
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
fail-on-vuln: true
|
||||
41
.snyk
41
.snyk
|
|
@ -1,41 +0,0 @@
|
|||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.25.0
|
||||
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
|
||||
ignore:
|
||||
'snyk:lic:golang:github.com:karalabe:usb:LGPL-3.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:06:37.028Z
|
||||
'snyk:lic:golang:github.com:mitchellh:cli:MPL-2.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:07:42.661Z
|
||||
'snyk:lic:golang:github.com:hashicorp:hcl:v2:MPL-2.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:08.112Z
|
||||
'snyk:lic:golang:github.com:hashicorp:go-multierror:MPL-2.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:14.673Z
|
||||
'snyk:lic:golang:github.com:hashicorp:go-bexpr:MPL-2.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:21.843Z
|
||||
'snyk:lic:golang:github.com:hashicorp:errwrap:MPL-2.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:28.257Z
|
||||
'snyk:lic:golang:github.com:ethereum:go-ethereum:LGPL-3.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:35.273Z
|
||||
'snyk:lic:golang:github.com:maticnetwork:polyproto:GPL-3.0':
|
||||
- '*':
|
||||
reason: 'As open source org, we have no issues with licenses'
|
||||
created: 2022-11-11T08:09:41.635Z
|
||||
'SNYK-GOLANG-GOLANGORGXNETHTTP2-3160322':
|
||||
- '*':
|
||||
reason: 'grpc working on a release to fix the issue'
|
||||
created: 2022-12-12T06:50:00.000Z
|
||||
patch: {}
|
||||
5
Makefile
5
Makefile
|
|
@ -66,8 +66,11 @@ test-txpool-race:
|
|||
test-race:
|
||||
$(GOTEST) --timeout 15m -race -shuffle=on $(TESTALL)
|
||||
|
||||
gocovmerge-deps:
|
||||
$(GOBUILD) -o $(GOBIN)/gocovmerge github.com/wadey/gocovmerge
|
||||
|
||||
test-integration:
|
||||
$(GOTEST) --timeout 60m -tags integration $(TESTE2E)
|
||||
$(GOTEST) --timeout 60m -cover -coverprofile=cover.out -covermode=atomic -tags integration $(TESTE2E)
|
||||
|
||||
escape:
|
||||
cd $(path) && go test -gcflags "-m -m" -run none -bench=BenchmarkJumpdest* -benchmem -memprofile mem.out
|
||||
|
|
|
|||
|
|
@ -306,7 +306,14 @@ func (w *trezorDriver) trezorExchange(req proto.Message, results ...proto.Messag
|
|||
return 0, err
|
||||
}
|
||||
|
||||
payload := make([]byte, 8+len(data))
|
||||
var payload []byte
|
||||
|
||||
if len(data) < 64*1024*1024 {
|
||||
payload = make([]byte, 8+len(data))
|
||||
} else {
|
||||
return 0, errors.New("data too large")
|
||||
}
|
||||
|
||||
copy(payload, []byte{0x23, 0x23})
|
||||
binary.BigEndian.PutUint16(payload[2:], trezor.Type(req))
|
||||
binary.BigEndian.PutUint32(payload[4:], uint32(len(data)))
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ syncmode = "full"
|
|||
# nodekeyhex = ""
|
||||
[p2p.discovery]
|
||||
# v5disc = false
|
||||
bootnodes = ["enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303"]
|
||||
bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"]
|
||||
# Uncomment below `bootnodes` field for Mumbai bootnode
|
||||
# bootnodes = ["enode://bdcd4786a616a853b8a041f53496d853c68d99d54ff305615cd91c03cd56895e0a7f6e9f35dbf89131044e2114a9a782b792b5661e3aff07faf125a98606a071@43.200.206.40:30303", "enode://209aaf7ed549cf4a5700fd833da25413f80a1248bd3aa7fe2a87203e3f7b236dd729579e5c8df61c97bf508281bae4969d6de76a7393bcbd04a0af70270333b3@54.216.248.9:30303"]
|
||||
# bootnodesv4 = []
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ var (
|
|||
ErrNotSuccessfulResponse = errors.New("error while fetching data from Heimdall")
|
||||
ErrNotInRejectedList = errors.New("milestoneID doesn't exist in rejected list")
|
||||
ErrNotInMilestoneList = errors.New("milestoneID doesn't exist in Heimdall")
|
||||
ErrServiceUnavailable = errors.New("service unavailable")
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -277,10 +278,18 @@ func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL
|
|||
return result, nil
|
||||
}
|
||||
|
||||
// 503 (Service Unavailable) is thrown when an endpoint isn't activated
|
||||
// yet in heimdall. E.g. when the hardfork hasn't hit yet but heimdall
|
||||
// is upgraded.
|
||||
if errors.Is(err, ErrServiceUnavailable) {
|
||||
log.Debug("Heimdall service unavailable at the moment", "path", url.Path, "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// attempt counter
|
||||
attempt := 1
|
||||
|
||||
log.Warn("an error while trying fetching from Heimdall", "attempt", attempt, "error", err)
|
||||
log.Warn("an error while trying fetching from Heimdall", "path", url.Path, "attempt", attempt, "error", err)
|
||||
|
||||
// create a new ticker for retrying the request
|
||||
ticker := time.NewTicker(retryCall)
|
||||
|
|
@ -307,9 +316,14 @@ retryLoop:
|
|||
request = &Request{client: client, url: url, start: time.Now()}
|
||||
result, err = Fetch[T](ctx, request)
|
||||
|
||||
if errors.Is(err, ErrServiceUnavailable) {
|
||||
log.Debug("Heimdall service unavailable at the moment", "path", url.Path, "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if attempt%logEach == 0 {
|
||||
log.Warn("an error while trying fetching from Heimdall", "attempt", attempt, "error", err)
|
||||
log.Warn("an error while trying fetching from Heimdall", "path", url.Path, "attempt", attempt, "error", err)
|
||||
}
|
||||
|
||||
continue retryLoop
|
||||
|
|
@ -426,6 +440,10 @@ func internalFetch(ctx context.Context, client http.Client, u *url.URL) ([]byte,
|
|||
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode == http.StatusServiceUnavailable {
|
||||
return nil, fmt.Errorf("%w: response code %d", ErrServiceUnavailable, res.StatusCode)
|
||||
}
|
||||
|
||||
// check status code
|
||||
if res.StatusCode != 200 && res.StatusCode != 204 {
|
||||
return nil, fmt.Errorf("%w: response code %d", ErrNotSuccessfulResponse, res.StatusCode)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/consensus"
|
||||
"github.com/ethereum/go-ethereum/consensus/beacon"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/heimdall"
|
||||
"github.com/ethereum/go-ethereum/consensus/clique"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/bloombits"
|
||||
|
|
@ -788,6 +789,10 @@ func (s *Ethereum) handleMilestone(ctx context.Context, ethHandler *ethHandler,
|
|||
ethHandler.downloader.ProcessFutureMilestone(num, hash)
|
||||
}
|
||||
|
||||
if errors.Is(err, heimdall.ErrServiceUnavailable) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -800,7 +805,10 @@ func (s *Ethereum) handleMilestone(ctx context.Context, ethHandler *ethHandler,
|
|||
func (s *Ethereum) handleNoAckMilestone(ctx context.Context, ethHandler *ethHandler, bor *bor.Bor) error {
|
||||
milestoneID, err := ethHandler.fetchNoAckMilestone(ctx, bor)
|
||||
|
||||
//If failed to fetch the no-ack milestone then it give the error.
|
||||
if errors.Is(err, heimdall.ErrServiceUnavailable) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor"
|
||||
"github.com/ethereum/go-ethereum/consensus/bor/heimdall"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
|
|
@ -63,6 +64,11 @@ func (h *ethHandler) fetchWhitelistMilestone(ctx context.Context, bor *bor.Bor,
|
|||
|
||||
// fetch latest milestone
|
||||
milestone, err := bor.HeimdallClient.FetchMilestone(ctx)
|
||||
if errors.Is(err, heimdall.ErrServiceUnavailable) {
|
||||
log.Debug("Failed to fetch latest milestone for whitelisting", "err", err)
|
||||
return num, hash, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Error("Failed to fetch latest milestone for whitelisting", "err", err)
|
||||
return num, hash, errMilestone
|
||||
|
|
@ -92,9 +98,13 @@ func (h *ethHandler) fetchNoAckMilestone(ctx context.Context, bor *bor.Bor) (str
|
|||
|
||||
// fetch latest milestone
|
||||
milestoneID, err := bor.HeimdallClient.FetchLastNoAckMilestone(ctx)
|
||||
if errors.Is(err, heimdall.ErrServiceUnavailable) {
|
||||
log.Debug("Failed to fetch latest no-ack milestone", "err", err)
|
||||
return milestoneID, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Error("Failed to fetch latest no-ack milestone", "err", err)
|
||||
|
||||
return milestoneID, errMilestone
|
||||
}
|
||||
|
||||
|
|
@ -104,6 +114,10 @@ func (h *ethHandler) fetchNoAckMilestone(ctx context.Context, bor *bor.Bor) (str
|
|||
func (h *ethHandler) fetchNoAckMilestoneByID(ctx context.Context, bor *bor.Bor, milestoneID string) error {
|
||||
// fetch latest milestone
|
||||
err := bor.HeimdallClient.FetchNoAckMilestone(ctx, milestoneID)
|
||||
if errors.Is(err, heimdall.ErrServiceUnavailable) {
|
||||
log.Debug("Failed to fetch no-ack milestone by ID", "milestoneID", milestoneID, "err", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// fixme: handle different types of errors
|
||||
if errors.Is(err, ErrNotInRejectedList) {
|
||||
|
|
|
|||
161
go.mod
161
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/ethereum/go-ethereum
|
||||
|
||||
go 1.20
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0
|
||||
|
|
@ -8,16 +8,16 @@ require (
|
|||
github.com/JekaMas/go-grpc-net-conn v0.0.0-20220708155319-6aff21f2d13d
|
||||
github.com/JekaMas/workerpool v1.1.8
|
||||
github.com/VictoriaMetrics/fastcache v1.6.0
|
||||
github.com/aws/aws-sdk-go-v2 v1.2.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.1.1
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.1.1
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.2.0
|
||||
github.com/aws/aws-sdk-go-v2 v1.21.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.18.43
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.13.41
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.29.5
|
||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2
|
||||
github.com/cespare/cp v1.1.1
|
||||
github.com/cloudflare/cloudflare-go v0.14.0
|
||||
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811
|
||||
github.com/consensys/gnark-crypto v0.9.1-0.20230105202408-1a7a29904a7c
|
||||
github.com/cosmos/cosmos-sdk v0.46.2
|
||||
github.com/consensys/gnark-crypto v0.12.0
|
||||
github.com/cosmos/cosmos-sdk v0.47.3
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/deckarep/golang-set/v2 v2.1.0
|
||||
github.com/docker/docker v24.0.5+incompatible
|
||||
|
|
@ -34,11 +34,11 @@ require (
|
|||
github.com/gofrs/flock v0.8.1
|
||||
github.com/golang-jwt/jwt/v4 v4.3.0
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/golang/protobuf v1.5.3
|
||||
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
|
||||
github.com/google/gofuzz v1.2.0
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/gorilla/websocket v1.5.0
|
||||
github.com/graph-gophers/graphql-go v1.3.0
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||
github.com/hashicorp/go-bexpr v0.1.10
|
||||
|
|
@ -61,37 +61,37 @@ require (
|
|||
github.com/maticnetwork/heimdall v0.3.1-0.20230227104835-81bd1055b0bc
|
||||
github.com/maticnetwork/polyproto v0.0.3-0.20230216113155-340ea926ca53
|
||||
github.com/mattn/go-colorable v0.1.13
|
||||
github.com/mattn/go-isatty v0.0.16
|
||||
github.com/mattn/go-isatty v0.0.17
|
||||
github.com/mitchellh/cli v1.1.2
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
github.com/peterh/liner v1.2.0
|
||||
github.com/rs/cors v1.7.0
|
||||
github.com/rs/cors v1.8.2
|
||||
github.com/ryanuber/columnize v2.1.2+incompatible
|
||||
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible
|
||||
github.com/status-im/keycard-go v0.2.0
|
||||
github.com/stretchr/testify v1.8.0
|
||||
github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/supranational/blst v0.3.11
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
|
||||
github.com/tendermint/tendermint v0.32.7
|
||||
github.com/tendermint/tendermint v0.34.21
|
||||
github.com/tyler-smith/go-bip39 v1.1.0
|
||||
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa
|
||||
golang.org/x/crypto v0.1.0
|
||||
golang.org/x/crypto v0.14.0
|
||||
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
|
||||
golang.org/x/sync v0.1.0
|
||||
golang.org/x/sys v0.6.0
|
||||
golang.org/x/text v0.8.0
|
||||
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
|
||||
golang.org/x/tools v0.7.0
|
||||
golang.org/x/sync v0.3.0
|
||||
golang.org/x/sys v0.13.0
|
||||
golang.org/x/text v0.13.0
|
||||
golang.org/x/time v0.3.0
|
||||
golang.org/x/tools v0.10.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.7.0 // indirect
|
||||
cloud.google.com/go/iam v0.5.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
|
||||
cloud.google.com/go/compute v1.21.0 // indirect
|
||||
cloud.google.com/go/iam v1.1.1 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pborman/uuid v1.2.1 // indirect
|
||||
|
|
@ -101,21 +101,21 @@ require (
|
|||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.104.0 // indirect
|
||||
cloud.google.com/go/pubsub v1.3.1 // indirect
|
||||
cloud.google.com/go v0.110.4 // indirect
|
||||
cloud.google.com/go/pubsub v1.32.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 // indirect
|
||||
github.com/DataDog/zstd v1.5.2 // indirect
|
||||
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
|
||||
github.com/agext/levenshtein v1.2.1 // indirect
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect
|
||||
github.com/aws/aws-sdk-go v1.34.28 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 // indirect
|
||||
github.com/aws/smithy-go v1.1.0 // indirect
|
||||
github.com/armon/go-radix v1.0.0 // indirect
|
||||
github.com/aws/aws-sdk-go v1.40.45 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.15.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.23.0 // indirect
|
||||
github.com/aws/smithy-go v1.14.2 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/cockroachdb/errors v1.9.1 // indirect
|
||||
|
|
@ -129,7 +129,7 @@ require (
|
|||
github.com/dlclark/regexp2 v1.7.0 // indirect
|
||||
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect
|
||||
github.com/getsentry/sentry-go v0.18.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
|
||||
|
|
@ -145,24 +145,24 @@ require (
|
|||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.39.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.10.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.5 // indirect
|
||||
github.com/tklauser/numcpus v0.2.2 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
github.com/xsleonard/go-merkle v1.1.0
|
||||
go.opentelemetry.io/otel v1.2.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.2.0
|
||||
go.opentelemetry.io/otel/sdk v1.2.0
|
||||
go.uber.org/goleak v1.1.12
|
||||
golang.org/x/mod v0.9.0 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
go.opentelemetry.io/otel v1.19.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
|
||||
go.opentelemetry.io/otel/sdk v1.19.0
|
||||
go.uber.org/goleak v1.2.1
|
||||
golang.org/x/mod v0.11.0 // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
gonum.org/v1/gonum v0.11.0
|
||||
google.golang.org/grpc v1.51.0
|
||||
google.golang.org/protobuf v1.28.1
|
||||
google.golang.org/grpc v1.58.2
|
||||
google.golang.org/protobuf v1.31.0
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gotest.tools v2.2.0+incompatible
|
||||
|
|
@ -171,62 +171,75 @@ require (
|
|||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 // indirect
|
||||
github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d // indirect
|
||||
github.com/bgentry/speakeasy v0.1.0 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.7.0 // indirect
|
||||
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
|
||||
github.com/btcsuite/btcd v0.22.3 // indirect
|
||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
|
||||
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
|
||||
github.com/cbergoon/merkletree v0.2.0 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 // indirect
|
||||
github.com/cosmos/ledger-cosmos-go v0.10.3 // indirect
|
||||
github.com/cosmos/ledger-go v0.9.2 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
|
||||
github.com/cosmos/go-bip39 v1.0.0 // indirect
|
||||
github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect
|
||||
github.com/etcd-io/bbolt v1.3.3 // indirect
|
||||
github.com/gammazero/deque v0.2.1 // indirect
|
||||
github.com/go-kit/kit v0.10.0 // indirect
|
||||
github.com/go-kit/kit v0.12.0 // indirect
|
||||
github.com/go-kit/log v0.2.1 // indirect
|
||||
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
||||
github.com/go-logr/logr v1.2.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-redis/redis v6.15.7+incompatible // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/gomodule/redigo v2.0.0+incompatible // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
|
||||
github.com/google/s2a-go v0.1.4 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/jmhodges/levigo v1.0.0 // indirect
|
||||
github.com/kelseyhightower/envconfig v1.4.0 // indirect
|
||||
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
||||
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
||||
github.com/magiconair/properties v1.8.6 // indirect
|
||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.0 // indirect
|
||||
github.com/posener/complete v1.1.1 // indirect
|
||||
github.com/posener/complete v1.2.3 // indirect
|
||||
github.com/rakyll/statik v0.1.7 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/spf13/afero v1.8.2 // indirect
|
||||
github.com/spf13/afero v1.9.2 // indirect
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/cobra v1.5.0 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.13.0 // indirect
|
||||
github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71 // indirect
|
||||
github.com/streadway/amqp v1.0.0 // indirect
|
||||
github.com/stumble/gorocksdb v0.0.3 // indirect
|
||||
github.com/tendermint/btcd v0.1.1 // indirect
|
||||
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
|
||||
github.com/tendermint/go-amino v0.15.0 // indirect
|
||||
github.com/tendermint/go-amino v0.16.0 // indirect
|
||||
github.com/tendermint/iavl v0.12.4 // indirect
|
||||
github.com/tendermint/tm-db v0.2.0 // indirect
|
||||
github.com/tendermint/tm-db v0.6.7 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.0.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.2 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
golang.org/x/oauth2 v0.3.0 // indirect
|
||||
gotest.tools/v3 v3.5.0 // indirect
|
||||
github.com/zondax/ledger-go v0.14.1 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.19.0 // indirect
|
||||
golang.org/x/oauth2 v0.10.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
|
||||
gotest.tools/v3 v3.5.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
@ -237,22 +250,24 @@ require (
|
|||
github.com/RichardKnop/machinery v1.7.4 // indirect
|
||||
github.com/RichardKnop/redsync v1.2.0 // indirect
|
||||
github.com/zclconf/go-cty v1.8.0 // indirect
|
||||
github.com/zondax/hid v0.9.0 // indirect
|
||||
github.com/zondax/hid v0.9.1 // indirect
|
||||
go.mongodb.org/mongo-driver v1.3.0 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.2.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.2.0
|
||||
go.opentelemetry.io/proto/otlp v0.10.0 // indirect
|
||||
google.golang.org/api v0.97.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.19.0
|
||||
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||
google.golang.org/api v0.126.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce // indirect
|
||||
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
|
||||
)
|
||||
|
||||
replace github.com/cosmos/cosmos-sdk => github.com/maticnetwork/cosmos-sdk v0.37.5-0.20220311095845-81690c6a53e7
|
||||
replace github.com/cosmos/cosmos-sdk => github.com/maticnetwork/cosmos-sdk v0.38.4
|
||||
|
||||
replace github.com/tendermint/tendermint => github.com/maticnetwork/tendermint v0.26.0-dev0.0.20220923185258-3e7c7f86ce9f
|
||||
replace github.com/tendermint/tendermint => github.com/maticnetwork/tendermint v0.33.0
|
||||
|
||||
replace github.com/ethereum/go-ethereum => github.com/maticnetwork/bor v0.4.0
|
||||
replace github.com/tendermint/tm-db => github.com/tendermint/tm-db v0.2.0
|
||||
|
||||
replace github.com/ethereum/go-ethereum => github.com/maticnetwork/bor v1.0.6
|
||||
|
||||
replace github.com/Masterminds/goutils => github.com/Masterminds/goutils v1.1.1
|
||||
|
||||
|
|
|
|||
|
|
@ -87,5 +87,7 @@ var mainnetBor = &Chain{
|
|||
Bootnodes: []string{
|
||||
"enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303",
|
||||
"enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303",
|
||||
"enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303",
|
||||
"enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1399,10 +1399,10 @@ func (c *Config) buildNode() (*node.Config, error) {
|
|||
// only check for non-developer modes
|
||||
if !c.Developer.Enabled {
|
||||
// Discovery
|
||||
// if no bootnodes are defined, use the ones from the chain file.
|
||||
// Append the bootnodes defined with those hardcoded in the config file
|
||||
bootnodes := c.P2P.Discovery.Bootnodes
|
||||
if len(bootnodes) == 0 {
|
||||
bootnodes = c.chain.Bootnodes
|
||||
if c.chain != nil {
|
||||
bootnodes = append(bootnodes, c.chain.Bootnodes...)
|
||||
}
|
||||
|
||||
if cfg.P2P.BootstrapNodes, err = parseBootnodes(bootnodes); err != nil {
|
||||
|
|
|
|||
|
|
@ -1742,6 +1742,7 @@ func newRPCTransactionFromBlockIndex(b *types.Block, index uint64, config *param
|
|||
// If the transaction is a bor transaction, we need to set the hash to the derived bor tx hash. BorTx is always the last index.
|
||||
if borReceipt != nil && index == uint64(len(txs)-1) {
|
||||
rpcTx.Hash = borReceipt.TxHash
|
||||
rpcTx.ChainID = nil
|
||||
}
|
||||
|
||||
return rpcTx
|
||||
|
|
@ -2021,6 +2022,7 @@ func (s *TransactionAPI) GetTransactionByHash(ctx context.Context, hash common.H
|
|||
// newRPCTransaction calculates hash based on RLP of the transaction data.
|
||||
// In case of bor block tx, we need simple derived tx hash (same as function argument) instead of RLP hash
|
||||
resultTx.Hash = hash
|
||||
resultTx.ChainID = nil
|
||||
}
|
||||
|
||||
return resultTx, nil
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ func (s *BlockChainAPI) appendRPCMarshalBorTransaction(ctx context.Context, bloc
|
|||
// newRPCTransaction calculates hash based on RLP of the transaction data.
|
||||
// In case of bor block tx, we need simple derived tx hash (same as function argument) instead of RLP hash
|
||||
marshalledTx.Hash = txHash
|
||||
marshalledTx.ChainID = nil
|
||||
fields["transactions"] = append(formattedTxs, marshalledTx)
|
||||
} else {
|
||||
fields["transactions"] = append(formattedTxs, txHash)
|
||||
|
|
|
|||
|
|
@ -1070,7 +1070,7 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP
|
|||
|
||||
var depsWg sync.WaitGroup
|
||||
|
||||
EnableMVHashMap := false
|
||||
EnableMVHashMap := w.chainConfig.Bor.IsParallelUniverse(env.header.Number)
|
||||
|
||||
// create and add empty mvHashMap in statedb
|
||||
if EnableMVHashMap {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package enode
|
|||
import (
|
||||
"crypto/ecdsa"
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
|
@ -211,8 +212,11 @@ func (ln *LocalNode) SetFallbackUDP(port int) {
|
|||
ln.mu.Lock()
|
||||
defer ln.mu.Unlock()
|
||||
|
||||
if port > 0 && port <= math.MaxUint16 {
|
||||
ln.endpoint4.fallbackUDP = uint16(port)
|
||||
ln.endpoint6.fallbackUDP = uint16(port)
|
||||
}
|
||||
|
||||
ln.updateEndpoints()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ gcmode = "archive"
|
|||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodes = []
|
||||
# bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
# static-nodes = []
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ syncmode = "full"
|
|||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
# static-nodes = []
|
||||
# trusted-nodes = []
|
||||
# trusted-nodes = ["<validator-ip>:<validator-p2p-port>"] # Recommended setting with sentry <> validator architecture
|
||||
# dns = []
|
||||
|
||||
# [heimdall]
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ syncmode = "full"
|
|||
# debug = true
|
||||
|
||||
[p2p]
|
||||
maxpeers = 1
|
||||
maxpeers = 20
|
||||
port = 30303
|
||||
nodiscover = true
|
||||
# maxpendpeers = 50
|
||||
|
|
@ -37,10 +37,10 @@ syncmode = "full"
|
|||
# txarrivalwait = "500ms"
|
||||
# [p2p.discovery]
|
||||
# v5disc = false
|
||||
# bootnodes = []
|
||||
# bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"]
|
||||
# bootnodesv4 = []
|
||||
# bootnodesv5 = []
|
||||
# static-nodes = []
|
||||
# static-nodes = ["<sentry-ip>:<sentry-p2p-port>"] # Recommended setting with sentry <> validator architecture
|
||||
# trusted-nodes = []
|
||||
# dns = []
|
||||
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ var MumbaiBootnodes = []string{
|
|||
var BorMainnetBootnodes = []string{
|
||||
"enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303",
|
||||
"enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303",
|
||||
"enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303",
|
||||
"enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303",
|
||||
}
|
||||
|
||||
var KilnBootnodes = []string{
|
||||
|
|
|
|||
19
trie/trie.go
19
trie/trie.go
|
|
@ -60,6 +60,9 @@ func (t *Trie) newFlag() nodeFlag {
|
|||
|
||||
// Copy returns a copy of Trie.
|
||||
func (t *Trie) Copy() *Trie {
|
||||
t.tracerMutex.Lock()
|
||||
defer t.tracerMutex.Unlock()
|
||||
|
||||
return &Trie{
|
||||
root: t.root,
|
||||
owner: t.owner,
|
||||
|
|
@ -366,7 +369,9 @@ func (t *Trie) insert(n node, prefix, key []byte, value node) (bool, node, error
|
|||
// New branch node is created as a child of the original short node.
|
||||
// Track the newly inserted node in the tracer. The node identifier
|
||||
// passed is the path from the root node.
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.onInsert(append(prefix, key[:matchlen]...))
|
||||
t.tracerMutex.Unlock()
|
||||
|
||||
// Replace it with a short node leading up to the branch.
|
||||
return true, &shortNode{key[:matchlen], branch, t.newFlag()}, nil
|
||||
|
|
@ -387,7 +392,9 @@ func (t *Trie) insert(n node, prefix, key []byte, value node) (bool, node, error
|
|||
// New short node is created and track it in the tracer. The node identifier
|
||||
// passed is the path from the root node. Note the valueNode won't be tracked
|
||||
// since it's always embedded in its parent.
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.onInsert(prefix)
|
||||
t.tracerMutex.Unlock()
|
||||
|
||||
return true, &shortNode{key, value, t.newFlag()}, nil
|
||||
|
||||
|
|
@ -453,7 +460,9 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
|
|||
// The matched short node is deleted entirely and track
|
||||
// it in the deletion set. The same the valueNode doesn't
|
||||
// need to be tracked at all since it's always embedded.
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.onDelete(prefix)
|
||||
t.tracerMutex.Unlock()
|
||||
|
||||
return true, nil, nil // remove n entirely for whole matches
|
||||
}
|
||||
|
|
@ -470,7 +479,9 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
|
|||
case *shortNode:
|
||||
// The child shortNode is merged into its parent, track
|
||||
// is deleted as well.
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.onDelete(append(prefix, n.Key...))
|
||||
t.tracerMutex.Unlock()
|
||||
|
||||
// Deleting from the subtrie reduced it to another
|
||||
// short node. Merge the nodes to avoid creating a
|
||||
|
|
@ -540,7 +551,9 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
|
|||
// Replace the entire full node with the short node.
|
||||
// Mark the original short node as deleted since the
|
||||
// value is embedded into the parent now.
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.onDelete(append(prefix, byte(pos)))
|
||||
t.tracerMutex.Unlock()
|
||||
|
||||
k := append([]byte{byte(pos)}, cnode.Key...)
|
||||
|
||||
|
|
@ -630,6 +643,9 @@ func (t *Trie) Hash() common.Hash {
|
|||
// Once the trie is committed, it's not usable anymore. A new trie must
|
||||
// be created with new root and updated trie database for following usage
|
||||
func (t *Trie) Commit(collectLeaf bool) (common.Hash, *NodeSet) {
|
||||
t.tracerMutex.Lock()
|
||||
defer t.tracerMutex.Unlock()
|
||||
|
||||
defer t.tracer.reset()
|
||||
|
||||
nodes := NewNodeSet(t.owner, t.tracer.accessList)
|
||||
|
|
@ -682,5 +698,8 @@ func (t *Trie) Reset() {
|
|||
t.root = nil
|
||||
t.owner = common.Hash{}
|
||||
t.unhashed = 0
|
||||
|
||||
t.tracerMutex.Lock()
|
||||
t.tracer.reset()
|
||||
t.tracerMutex.Unlock()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue