Skip to content

Commit

Permalink
Merge tag 'v1.2.4-beta' into release/polygon-1.x-fh2.3
Browse files Browse the repository at this point in the history
# Conflicts:
#	params/version.go
  • Loading branch information
maoueh committed Jan 31, 2024
2 parents 6c3c155 + 5d34ab4 commit 58593b1
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 30 deletions.
1 change: 1 addition & 0 deletions builder/files/genesis-testnet-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"berlinBlock": 13996000,
"londonBlock": 22640000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": {
"jaipurBlock": 22770000,
"delhiBlock": 29638656,
Expand Down
13 changes: 12 additions & 1 deletion cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

// bootnode runs a bootstrap node for the Ethereum Discovery Protocol.
package main
// Keep package as bootnode during upstram merge.
package bootnode

import (
"crypto/ecdsa"
Expand All @@ -34,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil"
)

// nolint
func main() {
var (
listenAddr = flag.String("addr", ":30301", "listen address")
Expand Down Expand Up @@ -213,3 +215,12 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *

return extaddr
}

// Implemented separate functions so that there are minimal conflicts during upstream merge
func PrintNotice(nodeKey *ecdsa.PublicKey, addr net.UDPAddr) {
printNotice(nodeKey, addr)
}

func DoPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *net.UDPAddr {
return doPortMapping(natm, ln, addr)
}
6 changes: 4 additions & 2 deletions eth/bor_checkpoint_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ var (
rewindLengthMeter = metrics.NewRegisteredMeter("chain/autorewind/length", nil)
)

const maxRewindLen uint64 = 126

type borVerifier struct {
verify func(ctx context.Context, eth *Ethereum, handler *ethHandler, start uint64, end uint64, hash string, isCheckpoint bool) (string, error)
}
Expand Down Expand Up @@ -117,8 +119,8 @@ func borVerify(ctx context.Context, eth *Ethereum, handler *ethHandler, start ui
}
}

if head-rewindTo > 255 {
rewindTo = head - 255
if head-rewindTo > maxRewindLen {
rewindTo = head - maxRewindLen
}

if isCheckpoint {
Expand Down
27 changes: 10 additions & 17 deletions internal/cli/bootnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"syscall"
"time"

"github.com/ethereum/go-ethereum/cmd/bootnode"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/cli/flagset"
Expand Down Expand Up @@ -213,33 +214,25 @@ func (b *BootnodeCommand) Run(args []string) int {
}

conn, err := net.ListenUDP("udp", addr)

if err != nil {
b.UI.Error(fmt.Sprintf("failed to listen udp addr '%s': %v", b.listenAddr, err))
return 1
}
defer conn.Close()

realaddr := conn.LocalAddr().(*net.UDPAddr)
if natm != nil {
if !realaddr.IP.IsLoopback() {
go nat.Map(natm, nil, "udp", realaddr.Port, realaddr.Port, "ethereum discovery")
}
db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey)

if ext, err := natm.ExternalIP(); err == nil {
// nolint: govet
realaddr = &net.UDPAddr{IP: ext, Port: realaddr.Port}
listenerAddr := conn.LocalAddr().(*net.UDPAddr)
if natm != nil {
natAddr := bootnode.DoPortMapping(natm, ln, listenerAddr)
if natAddr != nil {
listenerAddr = natAddr
}
}

n := enode.NewV4(&nodeKey.PublicKey, addr.IP, addr.Port, addr.Port)
b.UI.Info(n.String())

if b.dryRun {
return 0
}
bootnode.PrintNotice(&nodeKey.PublicKey, *listenerAddr)

db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey)
cfg := discover.Config{
PrivateKey: nodeKey,
Log: log.Root(),
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/chains/mumbai.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var mumbaiTestnet = &Chain{
BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &params.BorConfig{
JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"berlinBlock": 13996000,
"londonBlock": 13996000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor": {
"period": {
"0": 2,
Expand Down
1 change: 1 addition & 0 deletions internal/cli/server/chains/test_files/chain_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"berlinBlock":13996000,
"londonBlock":13996000,
"shanghaiBlock": 41874000,
"cancunBlock": 45648608,
"bor":{
"period":{
"0":2,
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.profile.amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.profile.arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
2 changes: 1 addition & 1 deletion packaging/templates/package_scripts/control.validator
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: bor-profile
Version: 1.2.3
Version: 1.2.4-beta
Section: develop
Priority: standard
Maintainer: Polygon <release-team@polygon.technology>
Expand Down
1 change: 1 addition & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ var (
BerlinBlock: big.NewInt(13996000),
LondonBlock: big.NewInt(22640000),
ShanghaiBlock: big.NewInt(41874000),
CancunBlock: big.NewInt(45648608),
Bor: &BorConfig{
JaipurBlock: big.NewInt(22770000),
DelhiBlock: big.NewInt(29638656),
Expand Down
8 changes: 4 additions & 4 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
)

const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 2 // Minor version component of the current release
VersionPatch = 3 // Patch version component of the current release
VersionMeta = "fh2.3" // Version metadata to append to the version string
VersionMajor = 1 // Major version component of the current release
VersionMinor = 2 // Minor version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionMeta = "beta-fh2.3" // Version metadata to append to the version string

FirehoseVersionMajor = 2
FirehoseVersionMinor = 3
Expand Down

0 comments on commit 58593b1

Please sign in to comment.