Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge qa to develop #814

Merged
merged 82 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
a0f754d
Adding in Mumbai/Mainnet precursor deb packaging for tests to use dur…
djpolygon Nov 22, 2022
5e92a7f
Added changes per discussion in PR, more changes may be necessary
djpolygon Nov 23, 2022
1f0e49b
Adding prerelease true
djpolygon Nov 23, 2022
ba56c98
Disabling goreleaser
djpolygon Nov 23, 2022
c1e84fd
Removing README swap file
djpolygon Nov 23, 2022
08ec50a
change bor_dir and add bor user for v0.3.0 release
rekibnikufesin Nov 23, 2022
e468e96
Merge pull request #592 from maticnetwork/wbutton/v0.3.0-docker-qa
rekibnikufesin Nov 23, 2022
3b6c9b0
Merge branch 'qa' of https://github.com/maticnetwork/bor into djpolyg…
manav2401 Nov 23, 2022
01e05cd
Merge pull request #590 from maticnetwork/djpolygon/v0.3.0packaging
djpolygon Nov 23, 2022
5fe83d3
rollback bor user and use root
rekibnikufesin Nov 23, 2022
58a6314
Merge pull request #594 from maticnetwork/wbutton/docker-user-rollback
rekibnikufesin Nov 23, 2022
137fb19
metrics: handle equal to separated config flag (#596)
manav2401 Nov 24, 2022
d69cb20
fixed static-nodes related buf (os independent) (#598)
pratikspatil024 Nov 25, 2022
095ce5e
Update default flags (#600)
manav2401 Nov 25, 2022
3e71609
metrics: handle nil telemetry config (#601)
manav2401 Nov 25, 2022
4b6115d
merge latest qa
temaniarpit27 Nov 29, 2022
59dccd3
resolve merge conflicts
temaniarpit27 Nov 29, 2022
d96662a
update go version in release.yml
temaniarpit27 Nov 29, 2022
742990c
update goversion in makefile
temaniarpit27 Nov 29, 2022
4d19cf5
update Docker login for goreleaser-cross v1.19
rekibnikufesin Nov 30, 2022
1cf78fd
Cleanup for the packager to use git tag in the package profile naming…
djpolygon Nov 30, 2022
3b4ff7d
Merge pull request #610 from maticnetwork/wbutton/goreleaser-docker-c…
rekibnikufesin Nov 30, 2022
4d06349
added a toml configuration file with comments describing each flag (#…
pratikspatil024 Dec 1, 2022
6cd5d15
Merge pull request #611 from maticnetwork/djpolygon/v030-cleanup
djpolygon Dec 1, 2022
dab3161
Adding of 0.3.0 package changes, control file updates, postinst chang…
djpolygon Dec 1, 2022
e330329
added ancient datadir flag and toml field, need to decide on default …
pratikspatil024 Dec 4, 2022
5d6ffa7
Merge pull request #613 from maticnetwork/djpolygon/v0.3.1-mumbai-update
djpolygon Dec 4, 2022
531d67a
updated toml files with ancient field
pratikspatil024 Dec 5, 2022
dd64fa1
Merge pull request #614 from maticnetwork/ancient-datadir
temaniarpit27 Dec 5, 2022
57075d0
Add support for new flags in new config.toml, which were present in o…
pratikspatil024 Dec 5, 2022
c807faa
merge current qa branch
temaniarpit27 Dec 5, 2022
adf8c5f
Merge branch 'arpit/v0.3.1-mumbai-candidate' of github.com:maticnetwo…
temaniarpit27 Dec 5, 2022
180d444
remove unwanted code
temaniarpit27 Dec 5, 2022
e68d2d1
Fix docker publish authentication issue
cffls Dec 5, 2022
9656c6c
Merge pull request #618 from cffls/master
cffls Dec 6, 2022
31da972
Revert "update Docker login for goreleaser-cross v1.19"
cffls Dec 6, 2022
43d894c
Bump version to stable
cffls Dec 6, 2022
d9e5e20
Merge pull request #620 from cffls/master
cffls Dec 6, 2022
b7f37c7
Merge pull request #603 from maticnetwork/arpit/v0.3.1-mumbai-candidate
temaniarpit27 Dec 13, 2022
6d11117
Revert "Merge pull request #435 from maticnetwork/POS-553"
manav2401 Dec 13, 2022
0b89983
merge latest master to qa
temaniarpit27 Dec 13, 2022
a8eb21f
Merge pull request #631 from maticnetwork/manav/revert-pos-533
temaniarpit27 Dec 13, 2022
7364f94
revert change for release for go1.19
temaniarpit27 Dec 13, 2022
b177669
Merge branch 'arpit/master-to-qa' of github.com:maticnetwork/bor into…
temaniarpit27 Dec 13, 2022
a37af35
Add default values to CLI helper and docs
cffls Dec 13, 2022
ddf1a4d
Add a summary of new CLI in docs
cffls Dec 14, 2022
5e14528
Merge pull request #632 from cffls/master
cffls Dec 14, 2022
2e45f3b
Updating packager as binutils changed version so that apt-get install…
djpolygon Dec 14, 2022
660677b
Merge branch 'master' of github.com:maticnetwork/bor into arpit/maste…
temaniarpit27 Dec 14, 2022
5eebbfa
Merge pull request #634 from maticnetwork/djpolygon/packagerDepUpdate
djpolygon Dec 14, 2022
b7ed9de
Add state pruning to new CLI
cffls Dec 14, 2022
9b2407a
Minor wording fix in prune state description
cffls Dec 15, 2022
7217f79
Merge pull request #630 from maticnetwork/arpit/master-to-qa
temaniarpit27 Dec 15, 2022
b7b1545
Bumping control file versions
djpolygon Dec 18, 2022
205930e
Merge pull request #639 from maticnetwork/djpolygon/3.2-beta_control
djpolygon Dec 19, 2022
59bdbef
Mainnet Delhi fork
cffls Jan 4, 2023
c12e8f2
Set version to stable
cffls Jan 4, 2023
db7eb29
change delhi hardfork block number
temaniarpit27 Jan 5, 2023
3eb234c
Merge pull request #647 from cffls/qa
temaniarpit27 Jan 5, 2023
b480db1
handle future chain import and skip peer drop (#650)
manav2401 Jan 7, 2023
dcdac12
Bump bor version in control files for v0.3.3 mainnet release
manav2401 Jan 9, 2023
56d3058
Merge pull request #655 from maticnetwork/manav/bump-control-files
cffls Jan 9, 2023
66c23d1
Merge pull request #664 from maticnetwork/master
0xsharma Jan 13, 2023
e4dd2ee
Added checks to RPC requests and introduced new flags to customise th…
pratikspatil024 Jan 19, 2023
241843c
chg : trieTimeout from 60 to 10 mins (#692)
0xsharma Jan 19, 2023
38145fa
internal/cli/server : fix : added triesInMemory in config (#691)
0xsharma Jan 19, 2023
168ec6e
changed version from 0.3.0 to 0.3.4-beta (#693)
pratikspatil024 Jan 19, 2023
cbbc27c
fix nil state-sync issue, increase grpc limit (#695)
manav2401 Jan 25, 2023
a533ffb
core, tests/bor: add more tests for state-sync validation (#710)
manav2401 Feb 2, 2023
2be6ae4
Arpit/temp bor sync (#701)
temaniarpit27 Feb 3, 2023
fe1034e
Revert "chg : trieTimeout from 60 to 10 mins (#692)" (#720)
manav2401 Feb 3, 2023
9fa20a7
Arpit/add execution pool 2 (#719)
temaniarpit27 Feb 3, 2023
67843e1
version change (#721)
temaniarpit27 Feb 3, 2023
22fa403
Event based pprof (#732)
JekaMas Feb 8, 2023
d9cc218
Cherry-pick changes from develop (#738)
manav2401 Feb 14, 2023
4916d75
add max code init size check in txpool (#739)
manav2401 Feb 14, 2023
79718d7
Revert "Event based pprof" and update version (#742)
manav2401 Feb 15, 2023
a853701
internal/ethapi :: Fix : newRPCTransactionFromBlockIndex
0xsharma Feb 27, 2023
ac353af
Merge master to qa (#813)
manav2401 Apr 6, 2023
e70f9fd
Merge branch 'qa' into manav/qa-to-develop
manav2401 Apr 6, 2023
977fe0a
core: remove duplicate tests
manav2401 Apr 6, 2023
303eda5
miner: use get validators by hash in tests
manav2401 Apr 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ chain = "mainnet"
datadir = "/var/lib/bor/data"
# ancient = ""
# keystore = "/var/lib/bor/keystore"
# "rpc.batchlimit" = 100
# "rpc.returndatalimit" = 100000
syncmode = "full"
# gcmode = "full"
# snapshot = true
Expand Down Expand Up @@ -86,13 +88,17 @@ syncmode = "full"
# api = ["eth", "net", "web3", "txpool", "bor"]
# vhosts = ["*"]
# corsdomain = ["*"]
# ep-size = 40
# ep-requesttimeout = "0s"
# [jsonrpc.ws]
# enabled = false
# port = 8546
# prefix = ""
# host = "localhost"
# api = ["web3", "net"]
# origins = ["*"]
# ep-size = 40
# ep-requesttimeout = "0s"
# [jsonrpc.graphql]
# enabled = false
# port = 0
Expand All @@ -106,7 +112,7 @@ syncmode = "full"
# port = 8551
# vhosts = ["localhost"]
# [jsonrpc.timeouts]
# read = "30s"
# read = "10s"
# write = "30s"
# idle = "2m0s"

Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func signer(c *cli.Context) error {
vhosts := utils.SplitAndTrim(c.GlobalString(utils.HTTPVirtualHostsFlag.Name))
cors := utils.SplitAndTrim(c.GlobalString(utils.HTTPCORSDomainFlag.Name))

srv := rpc.NewServer()
srv := rpc.NewServer(0, 0)
err := node.RegisterApis(rpcAPI, []string{"account"}, srv, false)
if err != nil {
utils.Fatalf("Could not register API: %w", err)
Expand Down
43 changes: 39 additions & 4 deletions consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ func (c *Bor) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Head
return c.verifyHeader(chain, header, nil)
}

func (c *Bor) GetSpanner() Spanner {
return c.spanner
}

func (c *Bor) SetSpanner(spanner Spanner) {
c.spanner = spanner
}

// VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers. The
// method returns a quit channel to abort the operations and a results channel to
// retrieve the async verifications (the order is that of the input slice).
Expand Down Expand Up @@ -457,6 +465,33 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t
return err
}

// Verify the validator list match the local contract
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
newValidators, err := c.spanner.GetCurrentValidatorsByBlockNrOrHash(context.Background(), rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber), number+1)

if err != nil {
return err
}

sort.Sort(valset.ValidatorsByAddress(newValidators))

headerVals, err := valset.ParseValidators(header.Extra[extraVanity : len(header.Extra)-extraSeal])

if err != nil {
return err
}

if len(newValidators) != len(headerVals) {
return errInvalidSpanValidators
}

for i, val := range newValidators {
if !bytes.Equal(val.HeaderBytes(), headerVals[i].HeaderBytes()) {
return errInvalidSpanValidators
}
}
}

// verify the validator list in the last sprint block
if IsSprintStart(number, c.config.CalculateSprint(number)) {
parentValidatorBytes := parent.Extra[extraVanity : len(parent.Extra)-extraSeal]
Expand Down Expand Up @@ -534,7 +569,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
hash := checkpoint.Hash()

// get validators and current span
validators, err := c.spanner.GetCurrentValidators(context.Background(), hash, number+1)
validators, err := c.spanner.GetCurrentValidatorsByHash(context.Background(), hash, number+1)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -704,7 +739,7 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e

// get validator set if number
if IsSprintStart(number+1, c.config.CalculateSprint(number)) {
newValidators, err := c.spanner.GetCurrentValidators(context.Background(), header.ParentHash, number+1)
newValidators, err := c.spanner.GetCurrentValidatorsByHash(context.Background(), header.ParentHash, number+1)
if err != nil {
return errUnknownValidators
}
Expand Down Expand Up @@ -1177,7 +1212,7 @@ func (c *Bor) CommitStates(
processStart := time.Now()
totalGas := 0 /// limit on gas for state sync per block
chainID := c.chainConfig.ChainID.String()
stateSyncs := make([]*types.StateSyncData, len(eventRecords))
stateSyncs := make([]*types.StateSyncData, 0, len(eventRecords))

var gasUsed uint64

Expand Down Expand Up @@ -1234,7 +1269,7 @@ func (c *Bor) SetHeimdallClient(h IHeimdallClient) {
}

func (c *Bor) GetCurrentValidators(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error) {
return c.spanner.GetCurrentValidators(ctx, headerHash, blockNumber)
return c.spanner.GetCurrentValidatorsByHash(ctx, headerHash, blockNumber)
}

//
Expand Down
15 changes: 9 additions & 6 deletions consensus/bor/heimdall/span/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *ChainSpanner) GetCurrentSpan(ctx context.Context, headerHash common.Has
}

// GetCurrentValidators get current validators
func (c *ChainSpanner) GetCurrentValidators(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error) {
func (c *ChainSpanner) GetCurrentValidatorsByBlockNrOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64) ([]*valset.Validator, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()

Expand All @@ -107,16 +107,13 @@ func (c *ChainSpanner) GetCurrentValidators(ctx context.Context, headerHash comm
toAddress := c.validatorContractAddress
gas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))

// block
blockNr := rpc.BlockNumberOrHashWithHash(headerHash, false)

result, err := c.ethAPI.Call(ctx, ethapi.TransactionArgs{
Gas: &gas,
To: &toAddress,
Data: &msgData,
}, blockNr, nil)
}, blockNrOrHash, nil)
if err != nil {
panic(err)
return nil, err
}

var (
Expand Down Expand Up @@ -144,6 +141,12 @@ func (c *ChainSpanner) GetCurrentValidators(ctx context.Context, headerHash comm
return valz, nil
}

func (c *ChainSpanner) GetCurrentValidatorsByHash(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error) {
blockNr := rpc.BlockNumberOrHashWithHash(headerHash, false)

return c.GetCurrentValidatorsByBlockNrOrHash(ctx, blockNr, blockNumber)
}

const method = "commitSpan"

func (c *ChainSpanner) CommitSpan(ctx context.Context, heimdallSpan HeimdallSpan, state *state.StateDB, header *types.Header, chainContext core.ChainContext) error {
Expand Down
4 changes: 3 additions & 1 deletion consensus/bor/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
)

//go:generate mockgen -destination=./span_mock.go -package=bor . Spanner
type Spanner interface {
GetCurrentSpan(ctx context.Context, headerHash common.Hash) (*span.Span, error)
GetCurrentValidators(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error)
GetCurrentValidatorsByHash(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error)
GetCurrentValidatorsByBlockNrOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64) ([]*valset.Validator, error)
CommitSpan(ctx context.Context, heimdallSpan span.HeimdallSpan, state *state.StateDB, header *types.Header, chainContext core.ChainContext) error
}
46 changes: 31 additions & 15 deletions consensus/bor/span_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading