Commit graph

12217 commits

Author SHA1 Message Date
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
017dcdd756
Merge pull request #737 from JukLee0ira/fix-node
node, p2p/simulations: fix node.Node AccountsManager leak
2024-11-25 16:35:40 +08:00
JukLee0ira
6f9fb9d1da node, p2p/simulations: fix node.Node AccountsManager leak (#19004) 2024-11-25 16:33:26 +08:00
Anil Chinchawale
fe801c88d4
Merge pull request #743 from XinFinOrg/bug-fix-use-right-block-to-count-vote-theshold
bug fix use right block to count vote threshold
2024-11-22 13:37:57 +05:30
liam.lai
809242223a bug fix use right block to count vote theshold 2024-11-22 00:04:39 -08:00
Daniel Liu
962be21184
Merge pull request #742 from gzliudan/fix-pr734
use global function when cli v1
2024-11-21 17:58:56 +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
8e72c6dafb
Merge pull request #739 from gzliudan/fix-preCheck
core: fix preCheck for RandomizeSMC after EIP-1559
2024-11-19 15:58:06 +08:00
Daniel Liu
4855f19261 core: fix preCheck for RandomizeSMC after EIP-1559 2024-11-19 14:19:57 +08:00
benjamin202410
370c6b62e7
update devnet 1559 block number (#736)
* update devnet 1559 block number

* update devnet 1559 block number

---------

Co-authored-by: liam.lai <liam.lai@us>
2024-11-17 21:23:19 -08:00
Daniel Liu
d7e72f3e71
Merge pull request #642 from gzliudan/rm-ewasm
core/vm: remove interface Interpreter
2024-11-15 22:30:53 +08:00
Daniel Liu
4cac1865ba all: remove noop vm config flags (#23111) 2024-11-15 20:12:49 +08:00
Daniel Liu
88cf3e7827
Merge pull request #647 from gzliudan/eip-1153
all: implement EIP-1153(transient storage)
2024-11-15 19:49:17 +08:00
Daniel Liu
ed242b4763 all: implement EIP-1153 transient storage (#26003) 2024-11-15 19:39:18 +08:00
Daniel Liu
1c5e564433
Merge pull request #733 from JukLee0ira/mobile-nuke
accounts, build, mobile: remove Android and iOS support
2024-11-15 15:48:48 +08:00
JukLee0ira
cba5782884 accounts, build, mobile: remove Android and iOS support (#26599) 2024-11-15 15:46:25 +08:00
Daniel Liu
77b0c0b88f
Merge pull request #734 from gzliudan/upgrade-log
upgrade package log to 2024-11-04
2024-11-15 15:41:25 +08:00
Daniel Liu
5bfaf068a4 log: fix issues with benchmarks (#30667) 2024-11-15 10:02:43 +08:00
Daniel Liu
54f8e028ca log: fix some functions comments (#29907)
updates some docstrings
---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2024-11-15 10:02:43 +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
368b2781ae log: using maps.Clone (#29392) 2024-11-15 10:02:42 +08:00
Daniel Liu
6831a49fea log: replace the outdated link (#29412) 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
40fd68a124 log: replace tmp with bytes.Buffer.AvailableBuffer (#29287) 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
fb25ddfa57 log: fix docstring names (#28923) 2024-11-15 10:02:42 +08:00
Daniel Liu
966a03f297 log: emit error level string as "error", not "eror" (#28774) 2024-11-15 10:02:42 +08:00
Daniel Liu
31ceca5ef1 log: avoid setting default slog logger in init (#28747)
slog.SetDefault has undesirable side effects. It also sets the default logger destination,
for example. So we should not call it by default in init.
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
Daniel Liu
ec4ca1ed6a all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00
Daniel Liu
b04ce3213a log: test for logging-output (#28373) 2024-11-15 10:02:42 +08:00
Daniel Liu
f9cae3b9aa internal, log: remove code for old unsupported go-versions (#28090) 2024-11-15 10:02:42 +08:00
Daniel Liu
41c4c9ba88 log: avoid stack lookups when not needed/used (#28069) 2024-11-15 10:02:42 +08:00
Daniel Liu
6b81e68537 log: use atomic types (#27763)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-11-15 10:02:42 +08:00
Daniel Liu
f75958c0ac log: report error when ctx key is non-string (#27226)
* log/format.go : invalid string cast fix

* log: some polish

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-11-15 10:02:42 +08:00
Daniel Liu
2359a9ed34 log: add special casing of uint256 into the logger (#26936) 2024-11-15 10:02:42 +08:00
Daniel Liu
5eca853e52 log: improve documentation (#26753)
Add usage examples
2024-11-15 10:02:42 +08:00
Daniel Liu
ed4f989ff3 log: allow tabs in log messages (#26630)
* log: allow tabs in log messages

This fixes a regression where panic reports in RPC handlers were quoted
because they contain tab characters.

* Update format.go
2024-11-15 10:02:42 +08:00
Daniel Liu
dce80d77b7 log: better sanitation (#26556) 2024-11-15 10:02:42 +08:00
Daniel Liu
0902dcf37c log: modify lock defer unlock order in sync handler (#24667)
This modifies the order of Lock() defer Unlock() to follow the more
typically used pattern.
2024-11-15 10:02:41 +08:00
Daniel Liu
07443431d3 log: fix formatting of big.Int (#22679)
* log: fix formatting of big.Int

The implementation of formatLogfmtBigInt had two issues: it crashed when
the number was actually large enough to hit the big integer case, and
modified the big.Int while formatting it.

* log: don't call FormatLogfmtInt64 for int16

* log: separate from decimals back, not front

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-11-15 10:02:41 +08:00
Daniel Liu
aedfea681b all: make logs a bit easier on the eye to digest (#22665) 2024-11-15 10:02:41 +08:00
Daniel Liu
3d21631145 log: fix typos in comments (#21118) 2024-11-15 10:02:41 +08:00
Daniel Liu
cd9e18984e log: properly escape character sequences (#20987) 2024-11-15 10:02:41 +08:00
Daniel Liu
25a7e096ff log: delete RotatingFileHandler (#20586) 2024-11-15 10:02:41 +08:00
Daniel Liu
4d9936574b log: fix staticcheck warnings (#20388) 2024-11-15 10:02:41 +08:00
Daniel Liu
6873ca0687 log: change http:// to https:// on links in README.md (#20178)
docs: change http to https on links in log/README.md
2024-11-15 10:02:41 +08:00