mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
chg: solve conflicts
This commit is contained in:
commit
8c14f12d68
13 changed files with 92 additions and 26 deletions
2
.github/ISSUE_TEMPLATE/bug.md
vendored
2
.github/ISSUE_TEMPLATE/bug.md
vendored
|
|
@ -6,7 +6,7 @@ labels: 'type:bug'
|
|||
assignees: ''
|
||||
---
|
||||
|
||||
Our support team has aggregated some common issues and their solutions from past which are faced while running or interacting with a bor client. In order to prevent redundant efforts, we would encourage you to have a look at the [FAQ's section](https://wiki.polygon.technology/docs/faq/technical-faqs/) of our documentation mentioning the same, before filing an issue here. In case of additional support, you can also join our [discord](https://discord.com/invite/0xPolygonDevs) server
|
||||
Our support team has aggregated some common issues and their solutions from past which are faced while running or interacting with a bor client. In order to prevent redundant efforts, we would encourage you to have a look at the [FAQ's section](https://wiki.polygon.technology/docs/faq/technical-faqs/) of our documentation mentioning the same, before filing an issue here. In case of additional support, you can also join our [discord](https://discord.com/invite/0xPolygonCommunity) server
|
||||
|
||||
<!--
|
||||
NOTE: Please make sure to check of any addresses / private keys / rpc url's / IP's before sharing the logs or anything from the additional information section (start.sh or heimdall config).
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/question.md
vendored
2
.github/ISSUE_TEMPLATE/question.md
vendored
|
|
@ -8,4 +8,4 @@ assignees: ''
|
|||
|
||||
This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation.
|
||||
|
||||
For general questions please join our [discord](https://discord.com/invite/0xPolygonDevs) server.
|
||||
For general questions please join our [discord](https://discord.com/invite/0xPolygonCommunity) server.
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
Bor is the Official Golang implementation of the Polygon PoS blockchain. It is a fork of [geth](https://github.com/ethereum/go-ethereum) and is EVM compatible (upto London fork).
|
||||
|
||||
[](https://pkg.go.dev/github.com/maticnetwork/bor)
|
||||
[](https://goreportcard.com/report/github.com/maticnetwork/bor)
|
||||

|
||||
[](https://discord.gg/0xpolygon)
|
||||
[](https://discord.com/invite/0xpolygonrnd)
|
||||
[](https://twitter.com/0xPolygon)
|
||||
|
||||
### Installing bor using packaging
|
||||
|
|
@ -79,4 +79,4 @@ included in our repository in the `COPYING` file.
|
|||
|
||||
## Join our Discord server
|
||||
|
||||
Join Polygon community – share your ideas or just say hi over [on Discord](https://discord.com/invite/0xPolygonDevs).
|
||||
Join Polygon community – share your ideas or just say hi over on [Polygon Community Discord](https://discord.com/invite/0xPolygonCommunity) or on [Polygon R&D Discord](https://discord.com/invite/0xpolygonrnd).
|
||||
|
|
|
|||
|
|
@ -391,8 +391,6 @@ func geth(ctx *cli.Context) error {
|
|||
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
|
||||
// miner.
|
||||
func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isConsole bool) {
|
||||
debug.Memsize.Add("node", stack)
|
||||
|
||||
// Start up the node itself
|
||||
utils.StartNode(ctx, stack, isConsole)
|
||||
|
||||
|
|
|
|||
|
|
@ -363,6 +363,7 @@ func (c *Bor) verifyHeader(chain consensus.ChainHeaderReader, header *types.Head
|
|||
}
|
||||
|
||||
if isSprintEnd && signersBytes%validatorHeaderBytesLength != 0 {
|
||||
log.Warn("Invalid validator set", "number", number, "signersBytes", signersBytes)
|
||||
return errInvalidSpanValidators
|
||||
}
|
||||
|
||||
|
|
@ -481,11 +482,13 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t
|
|||
}
|
||||
|
||||
if len(newValidators) != len(headerVals) {
|
||||
log.Warn("Invalid validator set", "block number", number, "newValidators", newValidators, "headerVals", headerVals)
|
||||
return errInvalidSpanValidators
|
||||
}
|
||||
|
||||
for i, val := range newValidators {
|
||||
if !bytes.Equal(val.HeaderBytes(), headerVals[i].HeaderBytes()) {
|
||||
log.Warn("Invalid validator set", "block number", number, "index", i, "local validator", val, "header validator", headerVals[i])
|
||||
return errInvalidSpanValidators
|
||||
}
|
||||
}
|
||||
|
|
@ -1420,6 +1423,11 @@ func getUpdatedValidatorSet(oldValidatorSet *valset.ValidatorSet, newVals []*val
|
|||
}
|
||||
|
||||
if err := v.UpdateWithChangeSet(changes); err != nil {
|
||||
changesStr := ""
|
||||
for _, change := range changes {
|
||||
changesStr += fmt.Sprintf("Address: %s, VotingPower: %d\n", change.Address, change.VotingPower)
|
||||
}
|
||||
log.Warn("Changes in validator set", "changes", changesStr)
|
||||
log.Error("Error while updating change set", "error", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
package core
|
||||
|
||||
// TEST CI
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"path/filepath"
|
||||
|
|
|
|||
|
|
@ -1196,6 +1196,62 @@ func TestApplyMVWriteSet(t *testing.T) {
|
|||
assert.Equal(t, sSingleProcess.IntermediateRoot(true), sClean.IntermediateRoot(true))
|
||||
}
|
||||
|
||||
func TestMVHashMapRevertConcurrent(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
db := NewDatabase(rawdb.NewMemoryDatabase())
|
||||
mvhm := blockstm.MakeMVHashMap()
|
||||
s, _ := NewWithMVHashmap(common.Hash{}, db, nil, mvhm)
|
||||
|
||||
states := []*StateDB{s}
|
||||
|
||||
// Create copies of the original state for each transition
|
||||
for i := 1; i <= 2; i++ {
|
||||
sCopy := s.Copy()
|
||||
sCopy.txIndex = i
|
||||
states = append(states, sCopy)
|
||||
}
|
||||
|
||||
addr := common.HexToAddress("0x01")
|
||||
balance := new(big.Int).SetUint64(uint64(100))
|
||||
|
||||
// Tx0 touches the account. Amount doesn't matter.
|
||||
// This is to make sure that Tx1 and Tx2 will use the same state object from Tx0.
|
||||
states[0].AddBalance(addr, common.Big0)
|
||||
states[0].Finalise(false)
|
||||
states[0].FlushMVWriteSet()
|
||||
|
||||
// Tx1 creates the account and add balance
|
||||
snapshot1 := states[1].Snapshot()
|
||||
states[1].CreateAccount(addr)
|
||||
states[1].AddBalance(addr, balance)
|
||||
|
||||
// Tx2 creates the account, reverts.
|
||||
snapshot2 := states[2].Snapshot()
|
||||
states[2].CreateAccount(addr)
|
||||
states[2].RevertToSnapshot(snapshot2)
|
||||
states[2].Finalise(false)
|
||||
|
||||
// Tx2 adds balance
|
||||
states[2].AddBalance(addr, balance)
|
||||
|
||||
// Tx1 now reverts
|
||||
states[1].RevertToSnapshot(snapshot1)
|
||||
states[1].Finalise(false)
|
||||
|
||||
// Balance after executing Tx0 should be 0 because it shouldn't be affected by Tx1 or Tx2
|
||||
b := states[0].GetBalance(addr)
|
||||
assert.Equal(t, common.Big0, b)
|
||||
|
||||
// Balance after executing Tx1 should be 0 because Tx1 got reverted
|
||||
b = states[1].GetBalance(addr)
|
||||
assert.Equal(t, common.Big0, b)
|
||||
|
||||
// Balance after executing Tx2 should be 100 because its snapshot is taken before Tx1 got reverted
|
||||
b = states[2].GetBalance(addr)
|
||||
assert.Equal(t, balance, b)
|
||||
}
|
||||
|
||||
// TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy.
|
||||
// See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512
|
||||
func TestCopyOfCopy(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -548,8 +548,14 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
|
|||
}
|
||||
|
||||
// Check whether the max code size has been exceeded, assign err if the case.
|
||||
if err == nil && evm.chainRules.IsEIP158 && len(ret) > params.MaxCodeSize {
|
||||
err = ErrMaxCodeSizeExceeded
|
||||
if err == nil && evm.chainRules.IsEIP158 {
|
||||
if evm.chainConfig.Bor != nil && evm.chainConfig.Bor.IsAhmedabad(evm.Context.BlockNumber) {
|
||||
if len(ret) > params.MaxCodeSizePostAhmedabad {
|
||||
err = ErrMaxCodeSizeExceeded
|
||||
}
|
||||
} else if len(ret) > params.MaxCodeSize {
|
||||
err = ErrMaxCodeSizeExceeded
|
||||
}
|
||||
}
|
||||
|
||||
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
||||
|
|
|
|||
3
go.mod
3
go.mod
|
|
@ -33,7 +33,6 @@ require (
|
|||
github.com/fatih/color v1.17.0
|
||||
github.com/ferranbt/fastssz v0.1.2
|
||||
github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e
|
||||
github.com/fjl/memsize v0.0.2
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08
|
||||
github.com/gofrs/flock v0.8.1
|
||||
|
|
@ -101,7 +100,7 @@ require (
|
|||
golang.org/x/text v0.16.0
|
||||
golang.org/x/time v0.5.0
|
||||
golang.org/x/tools v0.22.0
|
||||
google.golang.org/grpc v1.64.0
|
||||
google.golang.org/grpc v1.64.1
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
|
|
|||
5
go.sum
5
go.sum
|
|
@ -1159,7 +1159,6 @@ github.com/ferranbt/fastssz v0.1.2 h1:Dky6dXlngF6Qjc+EfDipAkE83N5I5DE68bY6O0VLNP
|
|||
github.com/ferranbt/fastssz v0.1.2/go.mod h1:X5UPrE2u1UJjxHA8X54u04SBwdAQjG2sFtWs39YxyWs=
|
||||
github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e h1:bBLctRc7kr01YGvaDfgLbTwjFNW5jdp5y5rj8XXBHfY=
|
||||
github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY=
|
||||
github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA=
|
||||
github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
|
||||
github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
|
||||
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||
|
|
@ -3219,8 +3218,8 @@ google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGO
|
|||
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
||||
google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
|
||||
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
|
||||
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
|
||||
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
|
||||
google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
|
||||
google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
|
|
|
|||
|
|
@ -31,15 +31,12 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/metrics/exp"
|
||||
"github.com/fjl/memsize/memsizeui"
|
||||
colorable "github.com/mattn/go-colorable"
|
||||
isatty "github.com/mattn/go-isatty"
|
||||
cli "github.com/urfave/cli/v2"
|
||||
lumberjack "gopkg.in/natefinch/lumberjack.v2"
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/mattn/go-isatty"
|
||||
"github.com/urfave/cli/v2"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
|
||||
var Memsize memsizeui.Handler
|
||||
|
||||
var (
|
||||
verbosityFlag = &cli.IntFlag{
|
||||
Name: "verbosity",
|
||||
|
|
@ -313,7 +310,6 @@ func StartPProf(address string, withMetrics bool) {
|
|||
if withMetrics {
|
||||
exp.Exp(metrics.DefaultRegistry)
|
||||
}
|
||||
http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
|
||||
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
|
||||
go func() {
|
||||
if err := http.ListenAndServe(address, nil); err != nil {
|
||||
|
|
|
|||
|
|
@ -675,6 +675,7 @@ type BorConfig struct {
|
|||
DelhiBlock *big.Int `json:"delhiBlock"` // Delhi switch block (nil = no fork, 0 = already on delhi)
|
||||
IndoreBlock *big.Int `json:"indoreBlock"` // Indore switch block (nil = no fork, 0 = already on indore)
|
||||
StateSyncConfirmationDelay map[string]uint64 `json:"stateSyncConfirmationDelay"` // StateSync Confirmation Delay, in seconds, to calculate `to`
|
||||
AhmedabadBlock *big.Int `json:"ahmedabadBlock"` // Ahmedabad switch block (nil = no fork, 0 = already on ahmedabad)
|
||||
}
|
||||
|
||||
// String implements the stringer interface, returning the consensus engine details.
|
||||
|
|
@ -714,6 +715,10 @@ func (c *BorConfig) CalculateStateSyncDelay(number uint64) uint64 {
|
|||
return borKeyValueConfigHelper(c.StateSyncConfirmationDelay, number)
|
||||
}
|
||||
|
||||
func (c *BorConfig) IsAhmedabad(number *big.Int) bool {
|
||||
return isBlockForked(c.AhmedabadBlock, number)
|
||||
}
|
||||
|
||||
// // TODO: modify this function once the block number is finalized
|
||||
// func (c *BorConfig) IsNapoli(number *big.Int) bool {
|
||||
// if c.NapoliBlock != nil {
|
||||
|
|
|
|||
|
|
@ -134,8 +134,9 @@ const (
|
|||
DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks.
|
||||
DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have.
|
||||
|
||||
MaxCodeSize = 24576 // Maximum bytecode to permit for a contract
|
||||
MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions
|
||||
MaxCodeSize = 24576 // Maximum bytecode to permit for a contract
|
||||
MaxCodeSizePostAhmedabad = 32768 // Maximum bytecode to permit for a contract post Ahmedabad hard fork (bor / polygon pos) (32KB)
|
||||
MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions
|
||||
|
||||
// Precompiled contract gas prices
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue