Commit graph

136 commits

Author SHA1 Message Date
Daniel Liu
240757a1ce all: remove empty function SaveData() 2024-12-28 09:04:02 +08:00
Daniel Liu
54570300cc all: ensure resp.body closed (#26969) 2024-12-13 14:00:13 +08:00
Daniel Liu
d55dca04b5 all: use http package to replace http method names (26535) 2024-12-05 10:59:42 +08:00
JukLee0ira
6f9fb9d1da node, p2p/simulations: fix node.Node AccountsManager leak (#19004) 2024-11-25 16:33:26 +08:00
Daniel Liu
22ad2f57ef node: fix websocket connection header check (#21646) 2024-11-13 09:35:41 +08:00
Daniel Liu
b1d6bec3bd cmd, node: dump empty value config (#21296) 2024-11-13 09:35:41 +08:00
Daniel Liu
ba23964062 node: shutdown HTTP and WebSocket servers gracefully (#20956) 2024-11-13 09:35:41 +08:00
Daniel Liu
b76438aafe node: allow WebSocket and HTTP work on same port (#20810) 2024-11-13 09:35:41 +08:00
Daniel Liu
d3c023ed37 cmd/XDC, internal, node: nuke XDC monitor (#19399) 2024-11-13 09:35:41 +08:00
Daniel Liu
68d9dcbee4 node: require LocalAppData variable (#19132) 2024-11-13 09:35:41 +08:00
Daniel Liu
3ed9ce95c1 eth, node: use APPDATA env to support cygwin/msys correctly (#17786) 2024-11-13 09:35:41 +08:00
Daniel Liu
fb2f822abe node: fix golint warnings 2024-11-13 09:35:41 +08:00
Daniel Liu
f9f172af76 rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. (#16333) 2024-11-13 09:33:18 +08:00
Daniel Liu
216ee418f1 cmd/utils, node: increase default maxpeers to 50 (#19497) 2024-11-04 16:13:02 +08:00
Daniel Liu
cec7dcb02a node: report actual port used for http rpc (#20789) 2024-11-04 12:31:16 +08:00
Daniel Liu
ef8fa666d3 node: prefer nil slices over zero-length slices (#19083) 2024-11-04 12:31:16 +08:00
Daniel Liu
4cb240981e node: fix a deadlock (#17891) 2024-11-04 12:31:16 +08:00
Daniel Liu
97a5ff616b rpc: Make HTTP server timeout values configurable (#17240) 2024-11-04 12:31:15 +08:00
Daniel Liu
56bce3983d rpc: clean up IPC handler (#16524) 2024-11-04 12:31:15 +08:00
Daniel Liu
6b653a22ad node: fix staticcheck warning SA1019: NewHTTPServer and NewWSServer are deprecated (#16154) 2024-11-04 12:31:15 +08:00
Daniel Liu
a79411fa06 all: fix staticcheck warning ST1005: incorrectly formatted error string 2024-10-24 09:48:20 +08:00
wanwiset25
cb792ef34f Revert EIP-2464 2024-08-24 02:31:27 +07:00
JukLee0ira
ad71d706fb all: add global block logs cache (#25459) 2024-08-03 10:03:22 +08: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
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
JukLee0ira
2d89951e5b all: use errrors.New instead of empty fmt.Errorf 2024-06-14 19:19:21 +08:00
Wanwiset Peerapatanapokin
aaa246f60e
PDF-01 (#397)
* replace deprecated ioutil lib calls

* fix for FileInfo type required

* fix for ioutil.Discard

* fix .Discard

* fix for go-bindata generated files
2024-01-19 15:05:03 +04:00
Daniel Liu
6f06a5638b add flag rpcwritetimeout for rpc http server (#358) 2023-11-27 22:48:56 +08:00
Banana-J
39f6e6ee56
upgrade the websocket in xdpos (#349) 2023-11-06 15:37:14 +11:00
Anil Chinchawale
72fb654a13
Update defaults.go 2021-12-05 11:50:15 +05:30
olumuyiwadad
b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30
olumuyiwadad
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30
dev-vadim
dbe8c9d984 upgrade XDC.Network with v1.8.27. 2020-12-23 16:32:06 +05:30
diglspacedavid
474cc37036 upgrade codebase with ethereum:v1.8.13 2020-11-23 13:40:30 +05:30
AnilChinchawale
969f18b06c p2p lib updated 2019-02-06 04:52:21 +05:30
AnilChinchawale
d5101dc3ed Condition added self.config.XDPoS != nil 2019-01-31 04:51:28 +05:30
Péter Szilágyi
af8daf91a6
node, rpc: log cleanups in ipc listener function (#18124)
node,rpc: remove unused log in ipc listener function
2018-12-10 13:15:03 +02:00
Felix Lange
f32790fb05 node: warn when using deprecated config/resource files (#18199) 2018-12-07 15:43:27 +02:00
Franklin
21dd59bd04 . 2018-11-20 22:16:40 +08:00
Martin Holst Swende
493903eede
core: better side-chain importing 2018-11-20 12:28:43 +02:00
parmarrushabh
5501a5707c fixed 2018-11-17 16:15:25 +05:30
parmarrushabh
abd494055b fix err download block on masternode 2018-11-14 11:29:48 +05:30
parmarrushabh
b0e95fcc58 fix reduce change code 2018-10-31 11:14:32 +05:30
parmarrushabh
cb5a55a904 change config from flag to toml file; fix tag listenaddr 2018-10-31 10:30:25 +05:30
Felix Lange
6f607de5d5
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.
2018-10-12 11:47:24 +02:00
Felix Lange
dcae0d348b
p2p/simulations: fix a deadlock and clean up adapters (#17891)
This fixes a rare deadlock with the inproc adapter:

- A node is stopped, which acquires Network.lock.
- The protocol code being simulated (swarm/network in my case)
  waits for its goroutines to shut down.
- One of those goroutines calls into the simulation to add a peer,
  which waits for Network.lock.

The fix for the deadlock is really simple, just release the lock
before stopping the simulation node.

Other changes in this PR clean up the exec adapter so it reports
node startup errors better and remove the docker adapter because
it just adds overhead.

In the exec adapter, node information is now posted to a one-shot
server. This avoids log parsing and allows reporting startup
errors to the simulation host.

A small change in package node was needed because simulation
nodes use port zero. Node.{HTTP,WS}Endpoint now return the live
endpoints after startup by checking the TCP listener.
2018-10-11 20:32:14 +02:00
Felix Lange
30cd5c1854
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.
2018-09-25 00:59:00 +02:00
Felföldi Zsolt
c4df67461f
Merge pull request #16333 from shazow/addremovetrustedpeer
rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.
2018-08-06 13:30:04 +02:00
MestryOmkar
831626de23 Add reward for signers and validators for reward checkpoint. 2018-08-04 14:11:24 +05:30