Commit graph

11832 commits

Author SHA1 Message Date
Daniel Liu
be2d40bcdd common/fdlimit: fix windows build (#19068) 2024-08-03 08:12:28 +08:00
Daniel Liu
9cedb25a8d common/fdlimit: cap on MacOS file limits, fixes #18994 (#19035) 2024-08-03 08:12:28 +08:00
Daniel Liu
cb8a9edd03 cmd/utils: max out the OS file allowance, don't cap to 2K (#18211) 2024-08-03 08:12:28 +08:00
Daniel Liu
4976b7cbb3
Fix some panic cuased by nil block, statedb, header (#578)
* fix panic during rollback

* eth/hooks: check nil stateDB to fix issue #271

* internal/ethapi: fix eth_call crash

* all: check nil statedb

* eth: check nil block for tracer api

* internal/ethapi: check nil header and block
2024-08-02 17:05:53 -07:00
Daniel Liu
e9e94e640d
core: save new blocks during reorg (#596) 2024-08-02 16:53:49 -07:00
Daniel Liu
a0081d998b
make MasternodeVotingSMC tx never timeout (#595) 2024-08-02 16:19:22 -07:00
Liam
a9c557730a
scale down devnet from 73 to 62 (#582) 2024-07-30 15:20:54 -07:00
Liam
308607c670
lower the devnet cert to recover devnet again (#594) 2024-07-29 16:43:56 -07:00
Liam
014eb1c2ed
lower the devnet cert to recover devnet (#592)
* lower the devnet cert to recover devnet

* lower the devnet cert to recover devnet
2024-07-29 07:34:28 -07:00
Liam
4b35f33559
Fix crash during reorg for v2.0.0 (#590) (#593)
* params: fix usage of IsXDCxDisable

* internal/ethapi: fix nil block in function DoCall during reorg

Co-authored-by: Daniel Liu <139250065@qq.com>
2024-07-29 07:19:19 -07:00
Liam
c637d2885a
Merge pull request #589 from XinFinOrg/merge-from-master
Merge from master
2024-07-23 00:56:02 -07:00
Liam Lai
9f003fc75f update to 2.3.1-beta1 2024-07-23 00:41:14 -07:00
Liam Lai
3a6b18c5cd Merge branch 'master' into merge-from-master 2024-07-23 00:38:59 -07:00
Liam
ad49e17909
Merge pull request #586 from gzliudan/fix-v200-sync
fix v2.0.0 sync problem for mainnet
2024-07-22 00:03:07 -07:00
Daniel Liu
520fb284f5 Revert "revert https://github.com/XinFinOrg/XDPoSChain/pull/497 behavior for v1 engine (#531)"
This reverts commit 2bbecdcbbc.
2024-07-18 10:24:20 +08:00
Liam
e16b3f5ab3
scale down devnet from 90 to 73 (#581) 2024-07-14 19:20:50 +10:00
Liam
dc52e578a0
update devnet deployment script (#580) 2024-07-14 19:20:34 +10:00
Liam
297b964393
downscale devnet (#579) 2024-07-14 00:17:40 +10:00
Wanwiset Peerapatanapokin
c8339db0d2
Merge pull request #571 from XinFinOrg/scale-down-devnet-from-108-to-90
scale down devnet from 108 to 90
2024-07-12 15:08:32 +04:00
Anil Chinchawale
3ae6f752bd
Merge pull request #575 from XinFinOrg/add-stable-sufix-in-the-mainnet-version
add stable sufix in the mainnet version
2024-07-09 18:43:39 +05:30
Liam Lai
950de52e42 add stable sufix in the mainnet version 2024-07-09 22:15:50 +10:00
Liam
d48e27038b
xdpos 2.0 release for mainnet (#574)
* xdpos 2.0 release for mainnet
2024-07-09 21:54:44 +10:00
Liam Lai
accbd20dec scale down devnet from 108 to 90 2024-07-06 00:11:26 +10:00
Wanwiset Peerapatanapokin
b09292a25b
Merge pull request #550 from XinFinOrg/increase-txpool-EIP-2464
Implement EIPs to support the increase of TX size limit configuration.
EIPs: 2464, 2364, 2124
2024-06-28 19:39:44 +04:00
wanwiset25
82f2f63df4 add explanation 2024-06-28 18:36:02 +04:00
wanwiset25
4be4f2eeb1 fix tests 2024-06-28 18:35:47 +04:00
wanwiset25
829ca9f198 let xdpos22(101) strictly 1 to 1 with eth64(64) protocol 2024-06-28 18:21:07 +04:00
wanwiset25
b5c7bd5cba enable bft and better protocol version check 2024-06-28 11:34:04 +04:00
wanwiset25
ebb9a63107 differentiate xdpos 2.2 protocol version 2024-06-28 11:33:04 +04:00
wanwiset25
57b11ab4c9 try use insertblock in fetcher 2024-06-28 11:33:04 +04:00
wanwiset25
da42d75839 add p2p logging 2024-06-28 11:33:04 +04:00
wanwiset25
c9ee3240fb fix tests 2024-06-28 11:33:04 +04:00
wanwiset25
9e04fd82cf add xdpos2 protocol condition 2024-06-28 11:33:04 +04:00
wanwiset25
1b781530c6 add xdpos protocol test cases 2024-06-28 11:33:04 +04:00
Kurkó Mihály
41fa412893 p2p: add ENR to PeerInfo (#19816) 2024-06-28 11:33:04 +04:00
Péter Szilágyi
1204fa954f eth: check propagated block malformation on receiption (#20546) 2024-06-28 11:33:04 +04:00
Martin Holst Swende
8f4a269437 eth, les: add sanity checks for unbounded block fields (#19573)
This PR adds some hardening in the lower levels of the protocol stack, to bail early on invalid data. Primarily, attacks that this PR protects against are on the "annoyance"-level, which would otherwise write a couple of megabytes of data into the log output, which is a bit resource intensive.
2024-06-28 11:33:04 +04:00
Péter Szilágyi
3f87990a71 core/forkid: add two clauses for more precise validation (#20220) 2024-06-28 11:33:04 +04:00
Péter Szilágyi
93b2a23216 core, eth: announce based transaction propagation (#20234) 2024-06-28 11:33:04 +04:00
wanwiset25
ae52ca6e83 eth: eth/64 - extend handshake with with fork id (#20140) 2024-06-28 11:31:06 +04:00
Shane Bammel
4707d1c549 core/forkid: fix off-by-one bug (#22879)
* forkid: added failing test

* forkid: fixed off-by-one bug
2024-06-28 11:30:31 +04:00
Péter Szilágyi
8e998ecabe core/forkid: implement the forkid EIP, announce via ENR (#19738)
* eth: chain config (genesis + fork) ENR entry

* core/forkid, eth: protocol independent fork ID, update to CRC32 spec

* core/forkid, eth: make forkid a struct, next uint64, enr struct, RLP

* core/forkid: change forkhash rlp encoding from int to [4]byte

* eth: fixup eth entry a bit and update it every block

* eth: fix lint

* eth: fix crash in ethclient tests
2024-06-28 11:30:31 +04:00
Felix Lange
3ca7a7c1d6 p2p, p2p/discover: add signed ENR generation (#17753)
This PR adds enode.LocalNode and integrates it into the p2p
subsystem. This new object is the keeper of the local node
record. For now, a new version of the record is produced every
time the client restarts. We'll make it smarter to avoid that in
the future.

There are a couple of other changes in this commit: discovery now
waits for all of its goroutines at shutdown and the p2p server
now closes the node database after discovery has shut down. This
fixes a leveldb crash in tests. p2p server startup is faster
because it doesn't need to wait for the external IP query
anymore.
2024-06-28 11:30:16 +04:00
wanwiset25
c72aabbac1 fix 2024-06-28 11:30:16 +04:00
Felix Lange
1bdf53662e all: new p2p node representation (#17643)
Package p2p/enode provides a generalized representation of p2p nodes
which can contain arbitrary information in key/value pairs. It is also
the new home for the node database. The "v4" identity scheme is also
moved here from p2p/enr to remove the dependency on Ethereum crypto from
that package.

Record signature handling is changed significantly. The identity scheme
registry is removed and acceptable schemes must be passed to any method
that needs identity. This means records must now be validated explicitly
after decoding.

The enode API is designed to make signature handling easy and safe: most
APIs around the codebase work with enode.Node, which is a wrapper around
a valid record. Going from enr.Record to enode.Node requires a valid
signature.

* p2p/discover: port to p2p/enode

This ports the discovery code to the new node representation in
p2p/enode. The wire protocol is unchanged, this can be considered a
refactoring change. The Kademlia table can now deal with nodes using an
arbitrary identity scheme. This requires a few incompatible API changes:

  - Table.Lookup is not available anymore. It used to take a public key
    as argument because v4 protocol requires one. Its replacement is
    LookupRandom.
  - Table.Resolve takes *enode.Node instead of NodeID. This is also for
    v4 protocol compatibility because nodes cannot be looked up by ID
    alone.
  - Types Node and NodeID are gone. Further commits in the series will be
    fixes all over the the codebase to deal with those removals.

* p2p: port to p2p/enode and discovery changes

This adapts package p2p to the changes in p2p/discover. All uses of
discover.Node and discover.NodeID are replaced by their equivalents from
p2p/enode.

New API is added to retrieve the enode.Node instance of a peer. The
behavior of Server.Self with discovery disabled is improved. It now
tries much harder to report a working IP address, falling back to
127.0.0.1 if no suitable address can be determined through other means.
These changes were needed for tests of other packages later in the
series.

* p2p/simulations, p2p/testing: port to p2p/enode

No surprises here, mostly replacements of discover.Node, discover.NodeID
with their new equivalents. The 'interesting' API changes are:

 - testing.ProtocolSession tracks complete nodes, not just their IDs.
 - adapters.NodeConfig has a new method to create a complete node.

These changes were needed to make swarm tests work.

Note that the NodeID change makes the code incompatible with old
simulation snapshots.

* whisper/whisperv5, whisper/whisperv6: port to p2p/enode

This port was easy because whisper uses []byte for node IDs and
URL strings in the API.

* eth: port to p2p/enode

Again, easy to port because eth uses strings for node IDs and doesn't
care about node information in any way.

* les: port to p2p/enode

Apart from replacing discover.NodeID with enode.ID, most changes are in
the server pool code. It now deals with complete nodes instead
of (Pubkey, IP, Port) triples. The database format is unchanged for now,
but we should probably change it to use the node database later.

* node: port to p2p/enode

This change simply replaces discover.Node and discover.NodeID with their
new equivalents.

* swarm/network: port to p2p/enode

Swarm has its own node address representation, BzzAddr, containing both
an overlay address (the hash of a secp256k1 public key) and an underlay
address (enode:// URL).

There are no changes to the BzzAddr format in this commit, but certain
operations such as creating a BzzAddr from a node ID are now impossible
because node IDs aren't public keys anymore.

Most swarm-related changes in the series remove uses of
NewAddrFromNodeID, replacing it with NewAddr which takes a complete node
as argument. ToOverlayAddr is removed because we can just use the node
ID directly.
2024-06-28 11:30:16 +04:00
Felföldi Zsolt
e65b81aad9 rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. (#16333) 2024-06-28 11:30:16 +04:00
Felix Lange
c0746461b5 p2p/enr: updates for discovery v4 compatibility (#16679)
This applies spec changes from ethereum/EIPs#1049 and adds support for
pluggable identity schemes.

Some care has been taken to make the "v4" scheme standalone. It uses
public APIs only and could be moved out of package enr at any time.

A couple of minor changes were needed to make identity schemes work:

- The sequence number is now updated in Set instead of when signing.
- Record is now copy-safe, i.e. calling Set on a shallow copy doesn't
  modify the record it was copied from.
2024-06-28 11:30:16 +04:00
Daniel Liu
bf289e89ea
Merge pull request #563 from gzliudan/fix-issue-377
fix issue #377 and a bug in queue
2024-06-27 14:10:51 +08:00
Daniel Liu
76ab0b5115 eth/downloader: fix issue #277 2024-06-27 12:51:47 +08:00
Guillaume Ballet
b3e0f70a33 eth/downloader: minor typo fixes in comments (#21035) 2024-06-27 11:28:40 +08:00