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

fix typos #1147

Merged
merged 43 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9956fdf
crypto/secp2561r1: add secp256r1 curve verifiers
ulerdogan May 8, 2023
cdb9609
core/vm: implement secp256r1 verifier precompiled
ulerdogan May 8, 2023
56f1933
params: add new precompiled gas price
ulerdogan May 8, 2023
ae2d3da
core/vm, params: rename precompiled to p256verify
ulerdogan May 16, 2023
83a20d3
core/vm: simplify the return values format
ulerdogan May 22, 2023
fc057aa
crypto/secp25r1: fix reverse malleability issue
ulerdogan May 22, 2023
40e6de0
core/vm: fix testdata non-malleable for p256Verify
ulerdogan May 22, 2023
b5559e3
core/vm: update the eip number
ulerdogan Jun 22, 2023
0d115db
core, crypto/secp256r1: fix error reverts tx error
ulerdogan Jun 22, 2023
d64d8e7
crypto/secp256r1: refactor by simplfying return
ulerdogan Aug 10, 2023
2bbf30f
core/vm: force the input length of p256verify
ulerdogan Sep 24, 2023
ab2f20e
crypto/secp256r1: reject the reference pubKey coordinates
ulerdogan Sep 24, 2023
738107b
crypto/secp256r1: remove malleability check due to spec
ulerdogan Oct 7, 2023
05a19f2
fix test, add napoli block
anshalshukla Nov 30, 2023
a0b925b
merge develop
anshalshukla Nov 30, 2023
e5fc28d
use config value for triesInMemory instead of default
temaniarpit27 Dec 27, 2023
46bd7d7
update version
temaniarpit27 Dec 27, 2023
7253bab
revert pruning hotfix
temaniarpit27 Dec 27, 2023
a517342
update version
temaniarpit27 Jan 11, 2024
70bebc9
Merge pull request #1116 from maticnetwork/arpit/v1.2.2-beta-candidate
temaniarpit27 Jan 11, 2024
1e5211c
add test cases
anshalshukla Jan 12, 2024
dac1a42
Update client.go to allow the use of paths with the heimdall url (#1126)
PeaStew Jan 15, 2024
70e4fe9
internal/ethapi: fix call with state api
manav2401 Jan 19, 2024
f92c3c0
graphql: fix eth call params
manav2401 Jan 19, 2024
603a425
Merge pull request #1124 from maticnetwork/consistent
temaniarpit27 Jan 19, 2024
0c08204
integration-tests: update ipc path on ci tests (#1127)
manav2401 Jan 18, 2024
16a8d85
Merge branch 'v1.2.3-candidate' of https://github.com/maticnetwork/bo…
manav2401 Jan 19, 2024
5fc30ae
Revert "Consistent"
temaniarpit27 Jan 19, 2024
4be8c0e
Merge pull request #1136 from maticnetwork/revert-1124-consistent
temaniarpit27 Jan 19, 2024
077bd41
Merge branch 'v1.2.3-candidate' of github.com:maticnetwork/bor into m…
temaniarpit27 Jan 19, 2024
59fa8cb
Merge branch 'v1.2.3-candidate' of github.com:maticnetwork/bor into e…
temaniarpit27 Jan 19, 2024
8d164b9
remove: kgz precompile
anshalshukla Jan 19, 2024
e070986
remove: kgz precompile
anshalshukla Jan 19, 2024
fe8d879
resolve: merge conflicts
anshalshukla Jan 19, 2024
eb528ae
update version
temaniarpit27 Jan 19, 2024
f907455
Merge branch 'v1.2.3-candidate' of github.com:maticnetwork/bor into v…
temaniarpit27 Jan 19, 2024
a24f66a
Merge pull request #1134 from maticnetwork/eip7212
temaniarpit27 Jan 19, 2024
c4e2a3f
Merge pull request #1133 from maticnetwork/manav/fix-eth-call
temaniarpit27 Jan 19, 2024
c629c0f
break loop when delayFlag becomes false (#1121)
zhiqiangxu Jan 22, 2024
c559619
fix bug: should use Lock when mutating the flag (#1141)
pratikspatil024 Jan 22, 2024
f1e0b1d
Changed parallel universe HF to Cancun HF and some important fixes (#…
pratikspatil024 Jan 23, 2024
241af1f
Merge pull request #1139 from maticnetwork/v1.2.3-candidate
manav2401 Jan 23, 2024
ce68cb1
fix typos
rex4539 Jan 25, 2024
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
1 change: 1 addition & 0 deletions .github/matic-cli-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ borDockerBuildContext: "../../bor"
heimdallDockerBuildContext: "https://github.com/maticnetwork/heimdall.git#develop"
sprintSizeBlockNumber:
- '0'
devnetBorFlags: config,config,config
2 changes: 1 addition & 1 deletion accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ var bindTests = []struct {
}
sim.Commit()

// This test the existence of the free retreiver call for view and pure functions
// This test the existence of the free retriever call for view and pure functions
if num, err := pav.PureFunc(nil); err != nil {
t.Fatalf("Failed to call anonymous field retriever: %v", err)
} else if num.Cmp(big.NewInt(42)) != 0 {
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (w *watcher) loop() {
return
}

log.Info("Filsystem watcher error", "err", err)
log.Info("Filesystem watcher error", "err", err)
case <-debounce.C:
w.ac.scanAccounts()

Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (hub *Hub) refreshWallets() {

continue
}
// Card connected, start tracking in amongs the wallets
// Card connected, start tracking in amongst the wallets
hub.wallets[reader] = wallet
events = append(events, accounts.WalletEvent{Wallet: wallet, Kind: accounts.WalletArrived})
}
Expand Down
2 changes: 1 addition & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var (
//
// This version is fine to be old and full of security holes, we just use it
// to build the latest Go. Don't change it. If it ever becomes insufficient,
// we need to switch over to a recursive builder to jumpt across supported
// we need to switch over to a recursive builder to jump across supported
// versions.
gobootVersion = "1.19.6"
)
Expand Down
1 change: 0 additions & 1 deletion builder/files/genesis-mainnet-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"bor": {
"jaipurBlock": 23850000,
"delhiBlock": 38189056,
"parallelUniverseBlock": 0,
"indoreBlock": 44934656,
"stateSyncConfirmationDelay": {
"44934656": 128
Expand Down
1 change: 0 additions & 1 deletion builder/files/genesis-testnet-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"bor": {
"jaipurBlock": 22770000,
"delhiBlock": 29638656,
"parallelUniverseBlock": 0,
"indoreBlock": 37075456,
"stateSyncConfirmationDelay": {
"37075456": 128
Expand Down
6 changes: 1 addition & 5 deletions cmd/evm/testdata/3/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
<<<<<<< HEAD
These files examplify a transition where a transaction (executed on block 5) requests
=======
These files exemplify a transition where a transaction (executed on block 5) requests
>>>>>>> bed84606583893fdb698cc1b5058cc47b4dbd837
the blockhash for block `1`.
the blockhash for block `1`.
6 changes: 1 addition & 5 deletions cmd/evm/testdata/4/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<<<<<<< HEAD
These files examplify a transition where a transaction (executed on block 5) requests
=======
These files exemplify a transition where a transaction (executed on block 5) requests
>>>>>>> bed84606583893fdb698cc1b5058cc47b4dbd837
the blockhash for block `4`, but where the hash for that block is missing.
the blockhash for block `4`, but where the hash for that block is missing.
It's expected that executing these should cause `exit` with errorcode `4`.
20 changes: 8 additions & 12 deletions consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (c *Bor) verifyHeader(chain consensus.ChainHeaderReader, header *types.Head
isSprintEnd := IsSprintStart(number+1, c.config.CalculateSprint(number))

// Ensure that the extra-data contains a signer list on checkpoint, but none otherwise
signersBytes := len(header.GetValidatorBytes(c.config))
signersBytes := len(header.GetValidatorBytes(c.chainConfig))

if !isSprintEnd && signersBytes != 0 {
return errExtraValidators
Expand Down Expand Up @@ -472,7 +472,7 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t

sort.Sort(valset.ValidatorsByAddress(newValidators))

headerVals, err := valset.ParseValidators(header.GetValidatorBytes(c.config))
headerVals, err := valset.ParseValidators(header.GetValidatorBytes(c.chainConfig))
if err != nil {
return err
}
Expand All @@ -490,7 +490,7 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t

// verify the validator list in the last sprint block
if IsSprintStart(number, c.config.CalculateSprint(number)) {
parentValidatorBytes := parent.GetValidatorBytes(c.config)
parentValidatorBytes := parent.GetValidatorBytes(c.chainConfig)
validatorsBytes := make([]byte, len(snap.ValidatorSet.Validators)*validatorHeaderBytesLength)

currentValidators := snap.ValidatorSet.Copy().Validators
Expand Down Expand Up @@ -521,7 +521,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
val := valset.NewValidator(signer, 1000)
validatorset := valset.NewValidatorSet([]*valset.Validator{val})

snapshot := newSnapshot(c.config, c.signatures, number, hash, validatorset.Validators)
snapshot := newSnapshot(c.chainConfig, c.signatures, number, hash, validatorset.Validators)

return snapshot, nil
}
Expand All @@ -541,7 +541,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co

// If an on-disk checkpoint snapshot can be found, use that
if number%checkpointInterval == 0 {
if s, err := loadSnapshot(c.config, c.signatures, c.db, hash); err == nil {
if s, err := loadSnapshot(c.chainConfig, c.config, c.signatures, c.db, hash); err == nil {
log.Trace("Loaded snapshot from disk", "number", number, "hash", hash)

snap = s
Expand Down Expand Up @@ -570,7 +570,7 @@ func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash co
}

// new snap shot
snap = newSnapshot(c.config, c.signatures, number, hash, validators)
snap = newSnapshot(c.chainConfig, c.signatures, number, hash, validators)
if err := snap.store(c.db); err != nil {
return nil, err
}
Expand Down Expand Up @@ -742,7 +742,7 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e
// sort validator by address
sort.Sort(valset.ValidatorsByAddress(newValidators))

if c.config.IsParallelUniverse(header.Number) {
if c.chainConfig.IsCancun(header.Number) {
var tempValidatorBytes []byte

for _, validator := range newValidators {
Expand All @@ -766,7 +766,7 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e
header.Extra = append(header.Extra, validator.HeaderBytes()...)
}
}
} else if c.config.IsParallelUniverse(header.Number) {
} else if c.chainConfig.IsCancun(header.Number) {
blockExtraData := &types.BlockExtraData{
ValidatorBytes: nil,
TxDependency: nil,
Expand Down Expand Up @@ -883,10 +883,6 @@ func (c *Bor) changeContractCodeIfNeeded(headerNumber uint64, state *state.State
for addr, account := range allocs {
log.Info("change contract code", "address", addr)
state.SetCode(addr, account.Code)

if state.GetBalance(addr).Cmp(big.NewInt(0)) == 0 {
state.SetBalance(addr, account.Balance)
}
}
}
}
Expand Down
31 changes: 7 additions & 24 deletions consensus/bor/bor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ func TestGenesisContractChange(t *testing.T) {
"balance": "0x1000",
},
},
"6": map[string]interface{}{
addr0.Hex(): map[string]interface{}{
"code": hexutil.Bytes{0x1, 0x4},
"balance": "0x2000",
},
},
},
},
}
Expand Down Expand Up @@ -91,35 +85,24 @@ func TestGenesisContractChange(t *testing.T) {

root := genesis.Root()

// code does not change, balance remains 0
// code does not change
root, statedb = addBlock(root, 1)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x1})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(0))

// code changes 1st time, balance remains 0
// code changes 1st time
root, statedb = addBlock(root, 2)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x2})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(0))

// code same as 1st change, balance remains 0
// code same as 1st change
root, statedb = addBlock(root, 3)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x2})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(0))

// code changes 2nd time, balance updates to 4096
root, statedb = addBlock(root, 4)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x3})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(4096))

// code same as 2nd change, balance remains 4096
root, statedb = addBlock(root, 5)
// code changes 2nd time
_, statedb = addBlock(root, 4)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x3})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(4096))

// code changes 3rd time, balance remains 4096
_, statedb = addBlock(root, 6)
require.Equal(t, statedb.GetCode(addr0), []byte{0x1, 0x4})
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(4096))
// make sure balance change DOES NOT take effect
require.Equal(t, statedb.GetBalance(addr0), big.NewInt(0))
}

func TestEncodeSigHeaderJaipur(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion consensus/bor/heimdall/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"net/http"
"net/url"
"path"
"sort"
"time"

Expand Down Expand Up @@ -420,7 +421,7 @@ func makeURL(urlString, rawPath, rawQuery string) (*url.URL, error) {
return nil, err
}

u.Path = rawPath
u.Path = path.Join(u.Path, rawPath)
u.RawQuery = rawQuery

return u, err
Expand Down
10 changes: 5 additions & 5 deletions consensus/bor/heimdall/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ func TestFetchShutdown(t *testing.T) {

// Expect this to fail due to timeout
_, err = client.FetchCheckpoint(ctx, -1)
require.Equal(t, "context deadline exceeded", err.Error(), "expect the function error to be a context deadline exeeded error")
require.Equal(t, "context deadline exceeded", ctx.Err().Error(), "expect the ctx error to be a context deadline exeeded error")
require.Equal(t, "context deadline exceeded", err.Error(), "expect the function error to be a context deadline exceeded error")
require.Equal(t, "context deadline exceeded", ctx.Err().Error(), "expect the ctx error to be a context deadline exceeded error")

cancel()

Expand Down Expand Up @@ -346,7 +346,7 @@ func TestContext(t *testing.T) {
select {
case <-ctx.Done():
// Expect this to never occur, throw explicit error
errCh <- errors.New("unexpectecd call to `ctx.Done()`")
errCh <- errors.New("unexpected call to `ctx.Done()`")
case <-time.After(2 * time.Second):
// Case for safely exiting the tests
errCh <- nil
Expand Down Expand Up @@ -399,7 +399,7 @@ func TestSpanURL(t *testing.T) {
const expected = "http://bor0/bor/span/1"

if url.String() != expected {
t.Fatalf("expected URL %q, got %q", url.String(), expected)
t.Fatalf("expected URL %q, got %q", expected, url.String())
}
}

Expand All @@ -414,6 +414,6 @@ func TestStateSyncURL(t *testing.T) {
const expected = "http://bor0/clerk/event-record/list?from-id=10&to-time=100&limit=50"

if url.String() != expected {
t.Fatalf("expected URL %q, got %q", url.String(), expected)
t.Fatalf("expected URL %q, got %q", expected, url.String())
}
}
25 changes: 13 additions & 12 deletions consensus/bor/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (

// Snapshot is the state of the authorization voting at a given point in time.
type Snapshot struct {
config *params.BorConfig // Consensus engine parameters to fine tune behavior
sigcache *lru.ARCCache // Cache of recent block signatures to speed up ecrecover
chainConfig *params.ChainConfig

sigcache *lru.ARCCache // Cache of recent block signatures to speed up ecrecover

Number uint64 `json:"number"` // Block number where the snapshot was created
Hash common.Hash `json:"hash"` // Block hash where the snapshot was created
Expand All @@ -28,14 +29,14 @@ type Snapshot struct {
// method does not initialize the set of recent signers, so only ever use if for
// the genesis block.
func newSnapshot(
config *params.BorConfig,
chainConfig *params.ChainConfig,
sigcache *lru.ARCCache,
number uint64,
hash common.Hash,
validators []*valset.Validator,
) *Snapshot {
snap := &Snapshot{
config: config,
chainConfig: chainConfig,
sigcache: sigcache,
Number: number,
Hash: hash,
Expand All @@ -47,7 +48,7 @@ func newSnapshot(
}

// loadSnapshot loads an existing snapshot from the database.
func loadSnapshot(config *params.BorConfig, sigcache *lru.ARCCache, db ethdb.Database, hash common.Hash) (*Snapshot, error) {
func loadSnapshot(chainConfig *params.ChainConfig, config *params.BorConfig, sigcache *lru.ARCCache, db ethdb.Database, hash common.Hash) (*Snapshot, error) {
blob, err := db.Get(append([]byte("bor-"), hash[:]...))
if err != nil {
return nil, err
Expand All @@ -61,7 +62,7 @@ func loadSnapshot(config *params.BorConfig, sigcache *lru.ARCCache, db ethdb.Dat

snap.ValidatorSet.UpdateValidatorMap()

snap.config = config
snap.chainConfig = chainConfig
snap.sigcache = sigcache

// update total voting power
Expand All @@ -85,7 +86,7 @@ func (s *Snapshot) store(db ethdb.Database) error {
// copy creates a deep copy of the snapshot, though not the individual votes.
func (s *Snapshot) copy() *Snapshot {
cpy := &Snapshot{
config: s.config,
chainConfig: s.chainConfig,
sigcache: s.sigcache,
Number: s.Number,
Hash: s.Hash,
Expand Down Expand Up @@ -122,12 +123,12 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
number := header.Number.Uint64()

// Delete the oldest signer from the recent list to allow it signing again
if number >= s.config.CalculateSprint(number) {
delete(snap.Recents, number-s.config.CalculateSprint(number))
if number >= s.chainConfig.Bor.CalculateSprint(number) {
delete(snap.Recents, number-s.chainConfig.Bor.CalculateSprint(number))
}

// Resolve the authorization key and check against signers
signer, err := ecrecover(header, s.sigcache, s.config)
signer, err := ecrecover(header, s.sigcache, s.chainConfig.Bor)
if err != nil {
return nil, err
}
Expand All @@ -145,12 +146,12 @@ func (s *Snapshot) apply(headers []*types.Header) (*Snapshot, error) {
snap.Recents[number] = signer

// change validator set and change proposer
if number > 0 && (number+1)%s.config.CalculateSprint(number) == 0 {
if number > 0 && (number+1)%s.chainConfig.Bor.CalculateSprint(number) == 0 {
if err := validateHeaderExtraField(header.Extra); err != nil {
return nil, err
}

validatorBytes := header.GetValidatorBytes(s.config)
validatorBytes := header.GetValidatorBytes(s.chainConfig)

// get validators from headers and use that for new validator set
newVals, _ := valset.ParseValidators(validatorBytes)
Expand Down
Loading
Loading