Commit graph

470 commits

Author SHA1 Message Date
Daniel Liu
b60396a233 core, internal/ethapi: improve function IsSpecialTransaction 2025-02-20 12:48:17 +08:00
Daniel Liu
0dd3d532fc eth: add eth_blobBaseFee RPC (#29140) 2025-02-10 10:59:45 +08:00
JukLee0ira
d6b136ed7c
consensus, internal, contracts: remove extra hash and string conversions (#830)
* consensus, internal: remove extra hash conversions

* contracts: remove extra string conversions
2025-02-07 13:59:07 +08:00
Daniel Liu
3f58066879 all: remove debug field from vm config (#27048) 2025-02-05 18:16:17 +08:00
Daniel Liu
6f37e85e80 accounts/abi: support unpacking solidity errors (#30738)
This PR adds the error fragments to `func (abi ABI) getArguments` which
allows typed decoding of errors.
2025-01-24 16:54:12 +08:00
Daniel Liu
b6c33b9a14 internal/ethapi, accounts/abi/bind: use errors.Is for error comparison (#28348)
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
cab293859a eth/filters: update Backend interface (#26126) 2025-01-24 16:54:11 +08:00
Daniel Liu
5b10b2441c all: use T.TempDir to create temporary test directories (#24633) 2025-01-24 16:54:08 +08:00
Daniel Liu
593fe53519 internal/ethapi: return revert reason for eth_call (#21083) 2025-01-24 16:18:29 +08:00
Daniel Liu
6a7b539c0e accounts, internal/ethapi: use common Accounts method (#18428)
* accounts/mananger, internal/ethapi/api: Add new function AllAccounts on account manager to remove the duplication code on getting all wallets accounts

* Rename to Accounts

* Rename to AllAccounts
2025-01-24 16:18:29 +08:00
Daniel Liu
07935ce124 accounts: support for external signer API (#18079) 2025-01-24 16:18:29 +08:00
Daniel Liu
fe14069bd7 accounts: support for external signer API (#18079) 2025-01-24 16:18:29 +08:00
Daniel Liu
ffbe4f5080 all: migrate go-bindata to embed (#24744) 2025-01-22 17:03:47 +08:00
Daniel Liu
adba311c5c
Merge pull request #788 from JukLee0ira/Migrate-to-rawdb
core/rawdb: separate raw database access to own package
2025-01-22 15:21:38 +08:00
JukLee0ira
653b59710e core/rawdb: separate raw database access to own package (#16666 #19345) 2025-01-22 15:19:39 +08:00
Daniel Liu
6794504d40 all: update files by 'go generate ./...' 2025-01-22 15:10:52 +08:00
Daniel Liu
588f61661c build: add imports for go generate tools (#24682) 2025-01-20 11:52:59 +08:00
Daniel Liu
00797dda0c build: add 'go mod tidy' checker 2025-01-15 10:10:38 +08:00
Daniel Liu
baea5d3da7 build: support golangci-lint v1.63.4 2025-01-11 23:56:59 +08:00
Daniel Liu
2baadc6e87 core: improve shutdown synchronization in BlockChain (#22853) 2024-12-28 10:44:49 +08:00
Daniel Liu
6e33633d28 common: drop BigMin and BigMax, they pollute our dep graph (#30645) 2024-12-28 09:06:31 +08:00
Daniel Liu
6ec35b9644 all: get rid of custom MaxUint64 and MaxUint64 (#30636) 2024-12-28 09:06:31 +08:00
Daniel Liu
59b14ed2cb internal/ethapi: make NewAccount return EIP-55 format (#26973) 2024-12-28 09:06:31 +08:00
Daniel Liu
d6d6906881 internal: add db operations to api (#24739) 2024-12-28 09:06:30 +08:00
Daniel Liu
7cd3e56d18 accounts/abi/bind: stop using goimports in the binding generator (#17768 #20311) 2024-12-28 09:06:30 +08:00
JukLee0ira
517f4a16a6 internal/ethapi: fix Call handle revert error 2024-12-28 09:02:48 +08:00
JukLee0ira
48d1f22fde all: simplify function TransitionDb (#20830) 2024-12-28 09:02:48 +08:00
JukLee0ira
7491a7ba74 all: improve EstimateGas API (#20830) 2024-12-21 14:35:44 +08:00
Daniel Liu
3dee6675d2 metrics/exp: allow configuring metrics HTTP server on separate endpoint (#21290) 2024-12-13 14:00:12 +08:00
Daniel Liu
23bc924585 internal/debug: start pprof server by new function StartPProf (#16532) 2024-12-13 14:00:11 +08:00
Daniel Liu
ad5e7d6db3 crypto: add SignatureLength constant and use it everywhere (#19996) 2024-12-09 17:48:59 +08:00
Daniel Liu
02a59e8d84 all: replace strings.Replace with string.ReplaceAll (#24835) 2024-12-08 11:51:14 +08:00
Daniel Liu
ae56946690 internal/flags: remove low-use type TextMarshalerFlag (#30707) 2024-11-25 16:39:29 +08:00
Daniel Liu
a6192a5980 internal/flags: fix --miner.gasprice default listing (#28932) 2024-11-25 16:39:29 +08:00
Daniel Liu
ac611170d1 internal/flags: add missing flag types for auto-env-var generation (#28692)
Certain flags, such as `--rpc.txfeecap` currently do not have an env-var auto-generated for them. This change adds three missing cli flag types to the auto env-var helper function to fix this.
2024-11-25 16:39:29 +08:00
Daniel Liu
4e192a5172 cmd/XDC, internal/flags: print envvar config source and bad names (#28119) 2024-11-25 16:39:29 +08:00
Daniel Liu
87ddf502ce internal/flags: fix loading env vars for custom flags (#28117) 2024-11-25 16:39:29 +08:00
Daniel Liu
197551c729 cmd/geth, internal/flags, go.mod: colorize cli help, support env vars (#28103) 2024-11-25 16:39:29 +08:00
Daniel Liu
fa69900737 Use filepath.clean instead of path.clean (#26404)
* internal/flags: use filepath.Clean instead of path.Clean

* internal/flags: fix windows pipe issue

* internal/flags: modify test for windows

* internal/flags: use backticks, fix test
2024-11-25 16:39:29 +08:00
Daniel Liu
9b8a82b91f internal/flags: fix issue with stringslice migration (#25830)
This fixes a cornercase bug where the flag migration would mess
up the value of StringSlice flags.
2024-11-25 16:39:29 +08:00
Daniel Liu
3e1ea87ca2 cmd/XDC: fix some cli parsing issues (#25234) 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
b883b0b593 internal/flags: fix flag redefined bug for cli v2 aliases (#30796) 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
bd916d100a cmd/evm, internal/debug: use global functions when cli v1 2024-11-21 17:40:51 +08:00
Daniel Liu
9e034475c8 log: default JSON log handler should log all verbosity levels (#29471)
Co-authored-by: lightclient <lightclient@protonmail.com>
2024-11-15 10:02:42 +08:00
Daniel Liu
946c085f9f log: use native log/slog instead of golang/exp (#29302) 2024-11-15 10:02:42 +08:00
Daniel Liu
20a62e4743 log: add Handler getter to Logger interface (#28793)
log: Add Handler getter to Logger interface
2024-11-15 10:02:42 +08:00
Daniel Liu
14acdf2dd1 log: remove lazy, remove unused interfaces, unexport methods (#28622)
This change

- Removes interface `log.Format`,
- Removes method `log.FormatFunc`,
- unexports `TerminalHandler.TerminalFormat` formatting methods (renamed to `TerminalHandler.format`)
- removes the notion of `log.Lazy` values

The lazy handler was useful in the old log package, since it
could defer the evaluation of costly attributes until later in the
log pipeline: thus, if the logging was done at 'Trace', we could
skip evaluation if logging only was set to 'Info'.

With the move to slog, this way of deferring evaluation is no longer
needed, since slog introduced 'Enabled': the caller can thus do
the evaluate-or-not decision at the callsite, which is much more
straight-forward than dealing with lazy reflect-based evaluation.

Also, lazy evaluation would not work with 'native' slog, as in, these
two statements would be evaluated differently:

```golang
  log.Info("foo", "my lazy", lazyObj)
  slog.Info("foo", "my lazy", lazyObj)
```
2024-11-15 10:02:42 +08:00
Daniel Liu
9ae7402e35 slog: faster and less memory-consumption (#28621)
These changes improves the performance of the non-coloured terminal formatting, _quite a lot_.

```
name               old time/op    new time/op    delta
TerminalHandler-8    10.2µs ±15%     5.4µs ± 9%  -47.02%  (p=0.008 n=5+5)

name               old alloc/op   new alloc/op   delta
TerminalHandler-8    2.17kB ± 0%    0.40kB ± 0%  -81.46%  (p=0.008 n=5+5)

name               old allocs/op  new allocs/op  delta
TerminalHandler-8      33.0 ± 0%       5.0 ± 0%  -84.85%  (p=0.008 n=5+5)
```

I tried to _somewhat_ organize the commits, but the it might still be a bit chaotic. Some core insights:

- The function `terminalHandler.Handl` uses a mutex, and writes all output immediately to 'upstream'. Thus, it can reuse a scratch-buffer every time.
- This buffer can be propagated internally, making all the internal formatters either write directly to it,
- OR, make  use of the `tmp := buf.AvailableBuffer()` in some cases, where a byte buffer "extra capacity" can be temporarily used.
- The `slog` package  uses `Attr` by value. It makes sense to minimize operating on them, since iterating / collecting into a new slice, iterating again etc causes copy-on-heap. Better to operate on them only once.
- If we want to do padding, it's better to copy from a constant `space`-buffer than to invoke `bytes.Repeat` every single time.
2024-11-15 10:02:42 +08:00