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

Increase txsize #550

Merged
merged 23 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c074646
p2p/enr: updates for discovery v4 compatibility (#16679)
fjl May 17, 2018
e65b81a
rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. (#16333)
zsfelfoldi Aug 6, 2018
1bdf536
all: new p2p node representation (#17643)
fjl Sep 24, 2018
c72aabb
fix
wanwiset25 May 17, 2024
3ca7a7c
p2p, p2p/discover: add signed ENR generation (#17753)
fjl Oct 12, 2018
8e998ec
core/forkid: implement the forkid EIP, announce via ENR (#19738)
karalabe Jul 8, 2019
4707d1c
core/forkid: fix off-by-one bug (#22879)
sjb933 May 18, 2021
ae52ca6
eth: eth/64 - extend handshake with with fork id (#20140)
wanwiset25 May 22, 2024
93b2a23
core, eth: announce based transaction propagation (#20234)
karalabe Feb 13, 2020
3f87990
core/forkid: add two clauses for more precise validation (#20220)
karalabe Oct 30, 2019
8f4a269
eth, les: add sanity checks for unbounded block fields (#19573)
holiman Jul 8, 2019
1204fa9
eth: check propagated block malformation on receiption (#20546)
karalabe Jan 13, 2020
41fa412
p2p: add ENR to PeerInfo (#19816)
kurkomisi Jul 19, 2019
1b78153
add xdpos protocol test cases
wanwiset25 May 26, 2024
9e04fd8
add xdpos2 protocol condition
wanwiset25 May 27, 2024
c9ee324
fix tests
wanwiset25 May 24, 2024
da42d75
add p2p logging
wanwiset25 May 27, 2024
57b11ab
try use insertblock in fetcher
wanwiset25 Jun 24, 2024
ebb9a63
differentiate xdpos 2.2 protocol version
wanwiset25 Jun 24, 2024
b5c7bd5
enable bft and better protocol version check
wanwiset25 Jun 27, 2024
829ca9f
let xdpos22(101) strictly 1 to 1 with eth64(64) protocol
wanwiset25 Jun 28, 2024
4be4f2e
fix tests
wanwiset25 Jun 28, 2024
82f2f63
add explanation
wanwiset25 Jun 28, 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
14 changes: 8 additions & 6 deletions cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/XinFinOrg/XDPoSChain/log"
"github.com/XinFinOrg/XDPoSChain/p2p/discover"
"github.com/XinFinOrg/XDPoSChain/p2p/discv5"
"github.com/XinFinOrg/XDPoSChain/p2p/enode"
"github.com/XinFinOrg/XDPoSChain/p2p/nat"
"github.com/XinFinOrg/XDPoSChain/p2p/netutil"
)
Expand Down Expand Up @@ -85,7 +86,7 @@ func main() {
}

if *writeAddr {
fmt.Printf("%v\n", discover.PubkeyID(&nodeKey.PublicKey))
fmt.Printf("%v\n", enode.PubkeyToIDV4(&nodeKey.PublicKey))
os.Exit(0)
}

Expand Down Expand Up @@ -118,16 +119,17 @@ func main() {
}

if *runv5 {
if _, err := discv5.ListenUDP(nodeKey, conn, realaddr, "", restrictList); err != nil {
if _, err := discv5.ListenUDP(nodeKey, conn, "", restrictList); err != nil {
utils.Fatalf("%v", err)
}
} else {
db, _ := enode.OpenDB("")
ln := enode.NewLocalNode(db, nodeKey)
cfg := discover.Config{
PrivateKey: nodeKey,
AnnounceAddr: realaddr,
NetRestrict: restrictList,
PrivateKey: nodeKey,
NetRestrict: restrictList,
}
if _, err := discover.ListenUDP(conn, cfg); err != nil {
if _, err := discover.ListenUDP(conn, ln, cfg); err != nil {
utils.Fatalf("%v", err)
}
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ import (
"github.com/XinFinOrg/XDPoSChain/log"
"github.com/XinFinOrg/XDPoSChain/node"
"github.com/XinFinOrg/XDPoSChain/p2p"
"github.com/XinFinOrg/XDPoSChain/p2p/discover"
"github.com/XinFinOrg/XDPoSChain/p2p/discv5"
"github.com/XinFinOrg/XDPoSChain/p2p/enode"
"github.com/XinFinOrg/XDPoSChain/p2p/nat"
"github.com/XinFinOrg/XDPoSChain/params"
"github.com/gorilla/websocket"
Expand Down Expand Up @@ -262,8 +262,10 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network u
return nil, err
}
for _, boot := range enodes {
old, _ := discover.ParseNode(boot.String())
stack.Server().AddPeer(old)
old, err := enode.ParseV4(boot.String())
if err != nil {
stack.Server().AddPeer(old)
}
}
// Attach to the client and retrieve and interesting metadatas
api, err := stack.Attach()
Expand Down
25 changes: 12 additions & 13 deletions cmd/p2psim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@
// Here is an example of creating a 2 node network with the first node
// connected to the second:
//
// $ p2psim node create
// Created node01
// $ p2psim node create
// Created node01
//
// $ p2psim node start node01
// Started node01
// $ p2psim node start node01
// Started node01
//
// $ p2psim node create
// Created node02
// $ p2psim node create
// Created node02
//
// $ p2psim node start node02
// Started node02
//
// $ p2psim node connect node01 node02
// Connected node01 to node02
// $ p2psim node start node02
// Started node02
//
// $ p2psim node connect node01 node02
// Connected node01 to node02
package main

import (
Expand All @@ -47,7 +46,7 @@ import (

"github.com/XinFinOrg/XDPoSChain/crypto"
"github.com/XinFinOrg/XDPoSChain/p2p"
"github.com/XinFinOrg/XDPoSChain/p2p/discover"
"github.com/XinFinOrg/XDPoSChain/p2p/enode"
"github.com/XinFinOrg/XDPoSChain/p2p/simulations"
"github.com/XinFinOrg/XDPoSChain/p2p/simulations/adapters"
"github.com/XinFinOrg/XDPoSChain/rpc"
Expand Down Expand Up @@ -283,7 +282,7 @@ func createNode(ctx *cli.Context) error {
if err != nil {
return err
}
config.ID = discover.PubkeyID(&privKey.PublicKey)
config.ID = enode.PubkeyToIDV4(&privKey.PublicKey)
config.PrivateKey = privKey
}
if services := ctx.String("services"); services != "" {
Expand Down
7 changes: 4 additions & 3 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import (
"github.com/XinFinOrg/XDPoSChain/metrics/exp"
"github.com/XinFinOrg/XDPoSChain/node"
"github.com/XinFinOrg/XDPoSChain/p2p"
"github.com/XinFinOrg/XDPoSChain/p2p/discover"
"github.com/XinFinOrg/XDPoSChain/p2p/discv5"
"github.com/XinFinOrg/XDPoSChain/p2p/enode"
"github.com/XinFinOrg/XDPoSChain/p2p/nat"
"github.com/XinFinOrg/XDPoSChain/p2p/netutil"
"github.com/XinFinOrg/XDPoSChain/params"
Expand Down Expand Up @@ -681,9 +681,10 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
case ctx.GlobalBool(XDCTestnetFlag.Name):
urls = params.TestnetBootnodes
}
cfg.BootstrapNodes = make([]*discover.Node, 0, len(urls))

cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls))
for _, url := range urls {
node, err := discover.ParseNode(url)
node, err := enode.ParseV4(url)
if err != nil {
log.Error("Bootstrap URL invalid", "enode", url, "err", err)
continue
Expand Down
10 changes: 5 additions & 5 deletions cmd/wnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"github.com/XinFinOrg/XDPoSChain/crypto"
"github.com/XinFinOrg/XDPoSChain/log"
"github.com/XinFinOrg/XDPoSChain/p2p"
"github.com/XinFinOrg/XDPoSChain/p2p/discover"
"github.com/XinFinOrg/XDPoSChain/p2p/enode"
"github.com/XinFinOrg/XDPoSChain/p2p/nat"
"github.com/XinFinOrg/XDPoSChain/whisper/mailserver"
whisper "github.com/XinFinOrg/XDPoSChain/whisper/whisperv6"
Expand Down Expand Up @@ -174,7 +174,7 @@ func initialize() {
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*argVerbosity), log.StreamHandler(os.Stderr, log.TerminalFormat(false))))

done = make(chan struct{})
var peers []*discover.Node
var peers []*enode.Node
var err error

if *generateKey {
Expand Down Expand Up @@ -202,7 +202,7 @@ func initialize() {
if len(*argEnode) == 0 {
argEnode = scanLineA("Please enter the peer's enode: ")
}
peer := discover.MustParseNode(*argEnode)
peer := enode.MustParseV4(*argEnode)
peers = append(peers, peer)
}

Expand Down Expand Up @@ -748,11 +748,11 @@ func requestExpiredMessagesLoop() {
}

func extractIDFromEnode(s string) []byte {
n, err := discover.ParseNode(s)
n, err := enode.ParseV4(s)
if err != nil {
utils.Fatalf("Failed to parse enode: %s", err)
}
return n.ID[:]
return n.ID().Bytes()
}

// obfuscateBloom adds 16 random bits to the the bloom
Expand Down
Loading