Commit graph

387 commits

Author SHA1 Message Date
Daniel Liu
e33909649b cmd/utils: don't enumerate usb when --usb isn't set (#22130) 2025-01-24 16:18:30 +08:00
Daniel Liu
100ea1c8e0 accounts/scwallet: add a switch to specify path to sc daemon (#19439) 2025-01-24 16:18:29 +08:00
Daniel Liu
97c50f97bb all: add read-only option to database 2025-01-24 14:24:39 +08:00
Daniel Liu
057a7dd780 cmd/abigen: refactor command line interface (#19797) 2024-12-28 09:06:30 +08:00
Daniel Liu
f19422e1c7 cmd/utils: relinquish GC cache to read cache in archive mode (#18991) 2024-12-28 09:06:30 +08:00
Daniel Liu
c0f547ca78 cmd/utils: fix bug when checking for flag value conflicts (#17803) 2024-12-28 09:06:30 +08:00
Daniel Liu
6beee27886 metrics, cmd/XDC: change init-process of metrics (#30814)
This PR modifies how the metrics library handles `Enabled`: previously,
the package `init` decided whether to serve real metrics or just
dummy-types.

This has several drawbacks:
- During pkg init, we need to determine whether metrics are enabled or
not. So we first hacked in a check if certain geth-specific
commandline-flags were enabled. Then we added a similar check for
geth-env-vars. Then we almost added a very elaborate check for
toml-config-file, plus toml parsing.

- Using "real" types and dummy types interchangeably means that
everything is hidden behind interfaces. This has a performance penalty,
and also it just adds a lot of code.

This PR removes the interface stuff, uses concrete types, and allows for
the setting of Enabled to happen later. It is still assumed that
`metrics.Enable()` is invoked early on.

The somewhat 'heavy' operations, such as ticking meters and exp-decay,
now checks the enable-flag to prevent resource leak.

The change may be large, but it's mostly pretty trivial, and from the
last time I gutted the metrics, I ensured that we have fairly good test
coverage.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-13 14:00:14 +08:00
Daniel Liu
2220156b9a cmd, core, metrics: always report expensive metrics (#29191)
* cmd, core, metrics: always report expensive metrics

* core, metrics: report block processing metrics as resetting timer

* metrics: update reporter tests
2024-12-13 14:00:13 +08:00
Daniel Liu
29b72dbba6 metrics/influxdb: support V2 (#23194) 2024-12-13 14:00:12 +08:00
Daniel Liu
db9487f1e8 core: split out detailed trie access metrics from insertion time (#19316) 2024-12-13 14:00:11 +08:00
Daniel Liu
3e4583e7c4 cmd/utils: allow for multiple influxdb flags (#18520) 2024-12-13 14:00:11 +08:00
Daniel Liu
92a7b64961 metrics: export to InfluxDB (#16979) 2024-12-13 14:00:11 +08:00
Daniel Liu
bedd571091 crypto/kzg4844: pull in the C and Go libs for KZG cryptography (#27155) 2024-12-09 17:49:00 +08:00
Daniel Liu
ae56946690 internal/flags: remove low-use type TextMarshalerFlag (#30707) 2024-11-25 16:39:29 +08:00
Daniel Liu
369d69649f all: normalize flag's name 2024-11-25 16:39:29 +08:00
Daniel Liu
dcab7e8efb cmd: migrate to urfave/cli/v2 (#24751) 2024-11-25 16:39:29 +08:00
Daniel Liu
ec4ca1ed6a all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00
JukLee0ira
85ede14a92 cmd: retire whisper flags (#22421) 2024-11-13 12:38:36 +08:00
JukLee0ira
749037a97c whisper: remove whisper (#21487) 2024-11-13 12:37:10 +08:00
Daniel Liu
b1d6bec3bd cmd, node: dump empty value config (#21296) 2024-11-13 09:35:41 +08:00
Daniel Liu
216ee418f1 cmd/utils, node: increase default maxpeers to 50 (#19497) 2024-11-04 16:13:02 +08:00
Daniel Liu
97a5ff616b rpc: Make HTTP server timeout values configurable (#17240) 2024-11-04 12:31:15 +08:00
Daniel Liu
8b2e8d9b3a all: refactor txpool into it's own package in prep for 4844 (#26038) 2024-11-01 11:36:53 +08:00
Daniel Liu
26fe46c008 eth/gasprice: implement feeHistory API (#23033) 2024-11-01 11:36:52 +08:00
liam.icheng.lai
59a7eb1f9f resolve conflict from master 2024-10-30 16:47:26 -07:00
Liam Lai
22fc7d0710 fix conflict 2024-10-16 22:42:53 -07:00
Mr.P
861c7102a2 cherry pick from #664 2024-10-09 17:08:59 +08:00
Mr.P
22c54206bd
add flag rpc-gascap and set RPCGasCap to 50M (#664)
* add gas cap flag

* default gas cap to 50m

* rpc-gascap
2024-10-09 09:28:24 +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
Daniel Liu
99c2e18b88 cmd/geth: move cache sanity check to SetEthConfig (#22510) 2024-08-03 08:12:28 +08:00
Daniel Liu
020fac603c cmd/utils: allow file descriptor limit to be set via CLI (#24477) 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
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
Daniel Liu
f445196dcf eth/gasprice: add configurable threshold to gas price oracle (#22752) 2024-06-20 15:52:32 +08:00
Daniel Liu
1521b8a663 eth: move eth.Config to a common package (#22205) 2024-06-20 15:52:32 +08:00
Daniel Liu
2125a1afaa eth/gasprice: offer maxprice flag for overwritting price cap (#21531) 2024-06-20 15:52:32 +08:00
Daniel Liu
56591d37e1 eth/gasprice: lighter gas price oracle for light client (#20409) 2024-06-20 15:52:32 +08:00
Daniel Liu
0063c14ed3 cmd, eth, internal, les: add gasprice cap (#21212) 2024-06-20 15:52:32 +08:00
Gary
0245344338 add TraceCall, backend.StateAtBlock(), RPCGasCap
update gen_config.go by tool `gencodec`
2024-05-17 21:34:34 +08:00
Wanwiset Peerapatanapokin
328176651c
use 0x address scheme by default and add new enable xdc prefix flag (#518) 2024-04-12 12:27:39 +07: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
Liam Lai
5623ce8de0 merge from master 2023-07-30 16:50:45 +10:00
wgr523
cd74061ac2
Extend masternode candidate (#261)
* V2 truncate MaxMasternodes from candidates after penalty,
V1 same as before

TestUpdateMultipleMasterNodes: test V2, in snapshot we have all candidates, but at epoch switch, we pick MaxMasternodes

* code looks better
2023-05-16 21:43:56 +08:00
Daniel Liu
6a768b04f9
add enable-0x-prefix flag (#194) 2022-12-09 19:15:13 +08:00
Jerome
bcffe1ec16
Give the XDC option to use emit metrics (#89) 2022-06-19 13:42:48 +02:00
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