Commit graph

1865 commits

Author SHA1 Message Date
Daniel Liu
e561f2842e core/types: drop type v4StoredReceiptRLP 2024-11-01 11:36:52 +08:00
Daniel Liu
b7154dd450 core: fix staticcheck warning S1006: use for {} for infinite loops 2024-10-31 16:49:56 +08:00
Daniel Liu
11285be830 all: fix staticcheck warning SA2002: must call T.Fatalf in same goroutine 2024-10-31 10:38:38 +08:00
Daniel Liu
6b6f0bd891 core, XDCxlending/lendingstate: fix staticcheck warning SA5001: must check error before rpcClient.Close() 2024-10-31 10:28:21 +08:00
Daniel Liu
371c3b6874 fix tautological condition: non-nil != nil 2024-10-31 09:01:12 +08:00
Daniel Liu
2306ceafb2 fix impossible condition: nil != nil 2024-10-31 09:01:12 +08:00
Daniel Liu
212daafe17 core: fix staticcheck warning SA6005: should use strings.EqualFold 2024-10-30 21:13:58 +08:00
Daniel Liu
181b23a767 core, XDCxlending/lendingstate: fix staticcheck warning S1002: omit comparison to bool constant 2024-10-30 21:02:41 +08:00
Daniel Liu
fbecb8c5a5 all: fix staticcheck warning ST1006: don't use generic name self
The name of a method’s receiver should be a reflection of its identity;
often a one or two letter abbreviation of its type suffices (such as
“c” or “cl” for “Client”). Don’t use generic names such as “me”, “this”
or “self”, identifiers typical of object-oriented languages that place
more emphasis on methods as opposed to functions. The name need not be
as descriptive as that of a method argument, as its role is obvious and
serves no documentary purpose. It can be very short as it will appear
on almost every line of every method of the type; familiarity admits
brevity. Be consistent, too: if you call the receiver “c” in one method,
don’t call it “cl” in another.
2024-10-25 21:30:54 +08:00
Daniel Liu
b68b9c64ea
Merge pull request #685 from gzliudan/emptyroot
all: use unified emptyRootHash and emptyCodeHash
2024-10-25 15:28:51 +08:00
Daniel Liu
87a6b5f4c3
Merge pull request #689 from gzliudan/fix-st1005
all: fix staticcheck warning ST1005
2024-10-25 15:28:07 +08:00
Daniel Liu
c6e4e880ea all: fix staticcheck warning SA4006: never used value 2024-10-24 17:37:19 +08:00
Daniel Liu
a79411fa06 all: fix staticcheck warning ST1005: incorrectly formatted error string 2024-10-24 09:48:20 +08:00
Daniel Liu
464a89074b all: use unified emptyRootHash and emptyCodeHash (#26718) 2024-10-21 17:55:16 +08:00
Daniel Liu
8c077345d0 all: removed blockhash from statedb (#23126) 2024-10-18 09:24:52 +08:00
Daniel Liu
1c84a31bb6 core/vm: deepcopy jumptable when enabling extra eips (#26137) 2024-10-17 11:23:04 +08:00
Daniel Liu
4482ea4d84 core/vm: fix docstrings 2024-10-17 11:23:04 +08:00
Daniel Liu
480adaf960 core/vm: minor trivial clean up (#25880) 2024-10-17 11:23:04 +08:00
Daniel Liu
69cb57a0f4 core/vm: not deep copy return data slice upon call completion (#25183) 2024-10-17 11:23:04 +08:00
Daniel Liu
ee5dd8673f core/vm: remove empty lines 2024-10-17 11:23:04 +08:00
Daniel Liu
16f2aabc64 core/vm: more linters (#24783) 2024-10-17 11:23:04 +08:00
Paweł Bylica
be6631beb0 core/vm: optimize jumpdest analysis (#23500)
core/vm: optimize PUSH opcode discrimination
2024-10-17 11:23:04 +08:00
Daniel Liu
1fa9e81870 core/vm: reduce overhead in instructions-benchmark (#24860) 2024-10-17 11:23:04 +08:00
Daniel Liu
c78b9e6245 core/vm: for tracing, do not report post-op memory (#24867) 2024-10-17 11:23:04 +08:00
Daniel Liu
45c644c43d core/vm: update benchmark to use Errorf instead of Sprintf (#24845) 2024-10-17 11:23:04 +08:00
Daniel Liu
6fa968201f core/vm: fix some typos 2024-10-17 11:23:04 +08:00
Daniel Liu
224caa5a08 core/vm: avoid memory expansion check for trivial ops (#24048) 2024-10-17 11:23:04 +08:00
Daniel Liu
532137c37b core/vm: use golang native big.Int (#26834) 2024-10-17 10:36:53 +08:00
Daniel Liu
8e15f825ce core/vm: use optimized bigint (#26021) 2024-10-17 10:36:53 +08:00
Daniel Liu
c87b7c3135 common/math: optimized modexp (#25525) 2024-10-17 10:36:53 +08:00
Daniel Liu
b653dbc60c core/vm, protocol_params: implement eip-2565 modexp repricing (#21607) 2024-10-17 10:36:53 +08:00
Daniel Liu
a8ea86e40c
Merge pull request #644 from gzliudan/format-0x
all: change format 0x%x to %#x
2024-10-17 10:35:34 +08:00
Daniel Liu
693190e5b9 core: fix wrong blockHash for eth_getLogs (#650) 2024-10-16 11:00:58 +08:00
Daniel Liu
edace6ac6c all: change format 0x%x to %#x (#25221) 2024-09-27 15:24:31 +08:00
JukLee0ira
47d27fed3b all: replace uses of ioutil with io and os (#24869) 2024-09-27 15:14:17 +08:00
Daniel Liu
4f9501f12c common, crypto: move fuzzers out of core (#22029) 2024-09-22 19:25:37 +08:00
Daniel Liu
a5531a2470 core/vm: remove redundant conversions (#21903) 2024-09-22 18:42:11 +08:00
Daniel Liu
67b5b2bf9a core/vm: less allocations for various call variants (#21222) 2024-09-22 18:42:11 +08:00
Daniel Liu
a575d731d3 core/vm: combine function precompile and precompile2 2024-09-21 22:40:57 +08:00
Daniel Liu
5470485450 all: split vm.Context into BlockContext and TxContext (#21672) 2024-09-21 22:18:10 +08:00
Daniel Liu
05e52efbad core/vm: marshall returnData as hexstring in trace logs (#21715) 2024-09-21 22:14:47 +08:00
Daniel Liu
4e832ee6f0 core/vm: avoid map lookups for accessing jumpdest analysis (#21411) 2024-09-21 22:01:56 +08:00
Daniel Liu
a020259bb5 core/vm: fix Byzantium address list (#22603) 2024-09-19 13:04:55 +08:00
Wanwiset Peerapatanapokin
0e9052b2e5
Merge branch 'master' into dev-upgrade-fix-merge 2024-09-11 14:06:38 +04:00
Daniel Liu
3e4932e408 core/vm: surface some internal methods (#20958) 2024-08-30 12:50:04 +08:00
Daniel Liu
1f45af089a core/vm: implement EIP 3541 (#22809) 2024-08-26 11:59:28 +08:00
Daniel Liu
c47819c7d6 core, cmd: add generic LRU implementation (#26162) 2024-08-26 11:17:23 +08:00
Daniel Liu
6f1d1b6688 core/vm: implement EIP-2681: Limit account nonce to 2^64-1 (#23853) 2024-08-26 09:04:15 +08:00
Wanwiset Peerapatanapokin
2b8eb6f98e
Merge pull request #619 from XinFinOrg/revert-2464-short
Revert EIP 2464
2024-08-25 02:23:46 +07:00
Daniel Liu
8c78a80771 core: fix race conditions in txpool (#23474) 2024-08-24 23:12:32 +08:00
wanwiset25
cb792ef34f Revert EIP-2464 2024-08-24 02:31:27 +07:00
Daniel Liu
45e57e41b4 internal/ethapi: refactor func ToMessage for CallArgs 2024-08-21 15:15:53 +08:00
JukLee0ira
3f40987cca core/rawdb: rearranging function order 2024-08-19 22:32:20 +08:00
JukLee0ira
544190f584 core: cache block hash and number 2024-08-07 14:59:36 +08:00
JukLee0ira
074095b1d5 core: fix writeBlock 2024-08-07 14:59:36 +08:00
wgr523
52077f18f3
support for golang tracers + add golang callTracer (#558)
* feat: rename Tracer interface to EVMLogger;
minor changes in API
refine api_tracer.go
refine Tracer interface

* fix: broken tracer tests

* feat: add BenchmarkTransactionTrace

* feat: tracer CaptureEnter CaptureExit in evm

* feat: upgrade js tracers with geth upstream

* chore: clean test

* feat: eth/tracers: support for golang tracers + add golang callTracer
cf. https://github.com/ethereum/go-ethereum/pull/23708

* chore: clean testdata json

* fix: change test due to IntrinsicGas is not upgraded

* feat: make native Tracer the default Tracer

* fix: update tracers.New in api

* fix: addr prefix in callTracer

* fix: remove `native` in BenchmarkTracers

* fix: return consensus error of InsufficientBalance for tx, instead of vmerr

* chore: drop js tracers: call and noop
2024-08-06 00:14:04 -07:00
JukLee0ira
9a40c26bf8 core,eth,light: remove duplicated functions 2024-08-03 10:03:22 +08:00
JukLee0ira
bea4431f6f eth/filters: avoid block body retrieval when no matching logs (#25199) 2024-08-03 10:03:22 +08:00
JukLee0ira
09d3ede8c0 core: cleanup tests (#25641) 2024-08-03 10:03:22 +08:00
JukLee0ira
ad71d706fb all: add global block logs cache (#25459) 2024-08-03 10:03:22 +08:00
JukLee0ira
f8a2b00505 core/rawdb,eth: use lightweight accessor for log filtering (#23147) 2024-08-03 10:03:22 +08:00
JukLee0ira
83782e5368 eth/filters: remove use of event.TypeMux for pending logs (#20312) 2024-08-03 10:03:22 +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
31098e717a
core: save new blocks during reorg (#599) 2024-08-02 16:55:41 -07:00
Daniel Liu
e9e94e640d
core: save new blocks during reorg (#596) 2024-08-02 16:53:49 -07:00
wanwiset25
4be4f2eeb1 fix tests 2024-06-28 18:35:47 +04:00
wanwiset25
57b11ab4c9 try use insertblock in fetcher 2024-06-28 11:33:04 +04:00
wanwiset25
c9ee3240fb fix tests 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
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
Daniel Liu
3e9bd359df ethclient: serialize negative block number as "pending" (#21177) 2024-06-20 15:52:32 +08:00
Daniel Liu
aa88078dd1 core/types: convert status type from uint to uint64 (#16784) 2024-06-20 15:52:32 +08:00
JukLee0ira
2d89951e5b all: use errrors.New instead of empty fmt.Errorf 2024-06-14 19:19:21 +08:00
JukLee0ira
15bbb5d3d5 XDCx,core,XDCxlending,miner: reduce duplicate calls 2024-06-06 19:33:59 +08:00
JukLee0ira
9ffacc595d core: simplify code expression 2024-06-06 19:33:59 +08:00
JukLee0ira
0aab4ced98 common: add binary variables for system contract 2024-06-06 19:33:59 +08:00
JukLee0ira
21c62f9ef0 XDCx,XDCxlending,consensus,core: not compare adresss by String 2024-06-06 19:33:39 +08:00
Daniel Liu
fd8811cc9e core, backends: rename callmsg to callMsg 2024-05-14 23:27:23 +08:00
Daniel Liu
e82bef5b87 core/types: remove duplication in eip2930 signer (#27860) 2024-05-14 23:27:23 +08:00
Daniel Liu
7a95b4f907 core, eth, internal/ethapi: create access list RPC API (#22550) 2024-05-14 23:27:23 +08:00
Daniel Liu
5cb014b60f core, eth/tracer: initialize tracer statedb in CaptureStart (#22333) 2024-05-14 23:27:23 +08:00
Derek Chiang
5edfd8f9eb core: fix method comment for txpool.requestReset (#22543) 2024-05-14 23:27:23 +08:00
Daniel Liu
349dc1bacd core/types: improve comments in new EIP-2718 code (#22402) 2024-05-14 23:15:35 +08:00
Daniel Liu
0ccf119cd7 core/types: reduce allocations in GasPriceCmp (#22456) 2024-05-14 23:15:35 +08:00
Daniel Liu
01e1728a94 all: add support for EIP-2718, EIP-2930 transactions (#21502) 2024-05-14 23:15:35 +08:00
Marius van der Wijden
76b29b2f25 core: reset txpool state on sethead (#22247)
fixes an issue where local transactions that were included in the chain before a SetHead were rejected if resubmitted, since the txpool had not reset the state to the current (older) state.
2024-05-14 11:44:26 +08:00
gary rong
289304f876 core/txpool: remove "local" notion from the txpool price heap (#21478)
* core: separate the local notion from the pricedHeap

* core: add benchmarks

* core: improve tests

* core: address comments

* core: degrade the panic to error message

* core: fix typo

* core: address comments

* core: address comment

* core: use PEAK instead of POP

* core: address comments
2024-05-14 11:08:53 +08:00
Martin Holst Swende
a6d591b01b core: fix txpool off-by-one error (#21683) 2024-05-14 10:09:43 +08:00
Marius van der Wijden
6935687790 core: more detailed metering for reorgs (#21420) 2024-05-13 22:07:04 +08:00
Hao Duan
28baf9f1fd core: avoid modification of accountSet cache in tx_pool (#21159)
* core: avoid modification of accountSet cache in tx_pool

when runReorg, we may copy the dirtyAccounts' accountSet cache to promoteAddrs
in which accounts will be promoted, however, if we have reset request at the
same time, we may reuse promoteAddrs and modify the cache content which is
against the original intention of accountSet cache. So, we need to make a new
slice here to avoid modify accountSet cache.

* core: fix flatten condition + comment

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-13 22:07:04 +08:00
Daniel Liu
b9f373fb57 core: fix queued transaction eviction #21300 2024-05-13 22:07:04 +08:00
Martin Holst Swende
ff246355a2 core: transaction pool optimizations (#21328)
* core: added local tx pool test case

* core, crypto: various allocation savings regarding tx handling

* core/txlist, txpool: save a reheap operation, avoid some bigint allocs

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-05-13 22:07:03 +08:00
Daniel Liu
48f9bbed50 core: types: less allocations when hashing and tx handling (#21265) 2024-05-13 22:07:03 +08:00
Hao Duan
1776bf1313 core: filter out txs with invalid signatures as soon as possible (#21170)
Once we detect an invalid transaction during recovering signatures, we should
directly exclude this transaction to avoid validating the signatures hereafter.

This should optimize the validations times of transactions with invalid signatures
to only one time.
2024-05-13 22:07:03 +08:00
chenglin
cf41742040 core: collect NewTxsEvent items without holding reorg lock (#21145) 2024-05-13 22:07:03 +08:00
Daniel Liu
624371433e core: fix typos in comments (#21118) 2024-05-13 22:07:03 +08:00
Daniel Liu
7179efd4da core: announce based transaction propagation (#20234) 2024-05-13 22:07:03 +08:00
Martin Holst Swende
d972bbd681 core: set max tx size down to 2 slots (64KB) 2024-05-13 22:07:03 +08:00
Daniel Liu
b7f4362c57 core: count tx size in slots, bump max size ot 4x32KB (#20352) 2024-05-13 22:07:03 +08:00
Péter Szilágyi
d1415837cf core: fix tx dedup return error count (#20085) 2024-05-13 22:07:03 +08:00
Daniel Liu
bef2c34e44 core: dedup known transactions without global lock, track metrics (#20081) 2024-05-13 22:07:03 +08:00
Martin Holst Swende
656f2a6167 core: smaller txpool status locking (#20080)
* txpool: smaller lock portion

* core/tx_pool: fix data race
2024-05-13 22:07:03 +08:00
Daniel Liu
19fb6103c0 fix: rename func AddRemoteSync to addRemoteSync 2024-05-13 22:07:03 +08:00
Daniel Liu
7cce425000 Revert "core, light, params: implement eip2028 (#19931)"
This reverts commit 67825d860b.
2024-05-11 06:11:46 +08:00
Daniel Liu
742a7f9348 core, metrics: switch some invalid counters to gauges (#20047) 2024-05-10 19:48:10 +08:00
Daniel Liu
67825d860b core, light, params: implement eip2028 (#19931) 2024-05-10 19:48:10 +08:00
Daniel Liu
b708614470 core, les: fix les unit tests (#19823) 2024-05-10 19:48:10 +08:00
Daniel Liu
edaed4fd92 core: fix write concurrency in txpool (#19835) 2024-05-10 19:48:10 +08:00
Daniel Liu
6338a4195b core: kill off managed state, use own tiny noncer for txpool (#19810) 2024-05-10 19:48:10 +08:00
Daniel Liu
74c72363d0 core: move TxPool reorg and events to background goroutine (#19705) 2024-05-10 19:48:10 +08:00
Daniel Liu
ddbf5d2782 core: expose various counter metrics for grafana (#19692) 2024-05-10 19:48:10 +08:00
Daniel Liu
65baaaaf80 core: cache tx signature before obtaining lock (#19351) 2024-05-10 19:48:10 +08:00
Daniel Liu
c5b22fbc32 core: make txpool handle reorg due to setHead (#19308) 2024-05-09 19:00:41 +08:00
Daniel Liu
676c4e8ec7 core: sanitize more TxPoolConfig fields (#17210) 2024-05-09 18:39:32 +08:00
Daniel Liu
6b87c07876 core: fix comment typo (#18144) 2024-05-09 18:38:27 +08:00
Daniel Liu
a6664651c7 core: fix a typo (#17733) 2024-05-09 18:38:27 +08:00
Daniel Liu
ec50ca36d9 core, eth, trie: use common/prque (#17508) 2024-05-09 18:38:27 +08:00
Daniel Liu
6c657ef6af core: priority mining (#17472) 2024-05-09 18:38:27 +08:00
Daniel Liu
41b29a8cf8 Fixed typo addresssByHeartbeat -> addressesByHeartbeat (#17243) 2024-05-09 18:38:27 +08:00
Daniel Liu
241201cf0e core: fixed typo (#17214) 2024-05-09 18:38:27 +08:00
Daniel Liu
5b883dee30 core/tx_pool: reduce judgement levels (#16980) 2024-05-09 18:38:27 +08:00
Daniel Liu
859308c03f core: change comment to match code more closely (#16963) 2024-05-09 18:38:27 +08:00
Daniel Liu
4f0f6e08c7 core: concurrent background transaction sender ecrecover (#16882) 2024-05-09 18:38:27 +08:00
Daniel Liu
fb89a5406b core: fix transaction event asynchronicity (#16843) 2024-05-09 18:38:27 +08:00
Daniel Liu
88695caf8f core: use a wrapped map w/ sync.RWMutex for TxPool.all to remove contention in TxPool.Get. (#16670) 2024-05-09 18:38:27 +08:00
Daniel Liu
2060ff7eeb core: Ensure that local transactions aren't discarded as underpriced (#16576) 2024-05-09 18:38:27 +08:00
Daniel Liu
702e0caa29 core: txpool stable underprice drop order, perf fixes (#16494) 2024-05-09 18:38:23 +08:00
Wang Gerui
4178a97560 feat: extend eth_call api with state override;
extend statedb and state_object with necessary code
2024-04-30 15:57:42 +08:00
Daniel Liu
8568af05cc all: implement EIP-2929 (gas cost increases for state access opcodes) (#21509) 2024-04-22 21:14:54 +08:00
Daniel Liu
3b9fc516f6
Merge pull request #524 from gzliudan/revert-pr320
Revert PR320
2024-04-22 21:04:44 +08:00
Wanwiset Peerapatanapokin
fb91c1e802
add trigger for disable XDCx precompiles (#509) 2024-04-22 11:43:22 +04:00
Daniel Liu
56d9a6e39c core, filters: not set log.BlockHash 2024-04-20 16:27:21 +08:00
Liam
ef4b8ef91b
Disable on xdcx receiver part (#521)
* update all IsTIPXDCXReceiver condition

* add TIPXDCXReceiverDisable on testnet and devnet
2024-04-19 22:17:22 +08:00
Daniel Liu
50847c9724 types, core, miner: add block location fields to receipt 2024-04-12 13:36:55 +08:00
wgr523
b5358663fe
Merge pull request #497 from XinFinOrg/xdf-05
XDF-05 fix: Future Blocks Are Always Verified Instead Of Queued
2024-04-01 20:48:58 +08:00
Daniel Liu
1c9f1d8279 all: change TxPreEvent to TxsPreEvent (#16720) 2024-03-28 11:16:21 +08:00
Wanwiset Peerapatanapokin
06b280aa0d
add log deepcopy to ensure complete replica of state (#449)
implement "deep copy" as go-ethereum
2024-03-26 13:40:07 +04:00
Gary
6fd9a5305a fix: Future Blocks Are Always Verified Instead Of Queued 2024-03-19 20:38:57 +08:00
Wanwiset Peerapatanapokin
8edb76f08d
Revert "core/state: abort commit if errors have occurred (#484)" (#489)
This reverts commit 0114ecabd0.
2024-03-13 11:54:09 +04:00
Daniel Liu
4616d59935 internal/ethapi: support block number or hash on state-related methods (#19491)
* Support for EIP-1898.
2024-03-12 10:40:03 +08:00
Wanwiset Peerapatanapokin
0114ecabd0
core/state: abort commit if errors have occurred (#484) 2024-03-11 13:19:24 +04:00
Wanwiset Peerapatanapokin
910d415653
Missing json Field Tags in Marshalled Struct (#475) 2024-03-08 15:38:33 +04:00
Daniel Liu
6a2f753cee
Merge pull request #472 from XinFinOrg/eip3855
core/vm: implement EIP-3855: PUSH0 instruction.
2024-03-07 23:01:33 +08:00
geruiwang
863d4f14e3 eth/tracers/js: fix isPush for push0 (#28520)
Fixes so that `push0` opcode is correctly reported as `true` by the `IsPush` function

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-07 22:31:19 +08:00
geruiwang
968440ce3d core/vm: implement EIP-3855: PUSH0 instruction. 2024-03-07 21:44:37 +08:00
Wang Gerui
0e36b5be42 fix typo in EIPs 2024-03-07 21:37:33 +08:00
Wanwiset Peerapatanapokin
ae10d7090c
Rollback privacy (#477)
Rollback the previous test removal or privacy package on devnet.

This reverts commit 4f79e535b37dc85144e2d38c2f2570b0ce4305b2.

This reverts commit 5a2722c268ec4f03f3117b1af2dee2411af4b13a.
2024-03-07 10:40:55 +04:00
Daniel Liu
ece58f00b5 ethapi: add method eth_getAccountInfo 2024-03-06 14:11:15 +08:00
Daniel Liu
bbe08ac6e6 core/state: add function GetStorageRoot 2024-03-06 14:10:08 +08:00
Liam
38a192e672
Merge pull request #459 from XinFinOrg/eip4399
implement EIP-4399, PREVRANDAO opcode
2024-03-04 17:50:56 +11:00
Wanwiset Peerapatanapokin
b86c7f646f
Try remove privacy pkg (#466)
* try removing privacy pkg

* rm more reference

* trigger CI
2024-03-04 07:59:45 +04:00
Gerui Wang
a31489541d implement EIP-4399, PREVRANDAO opcode.
and remove unused LondonBlock and BerlinBlock in `params/config.go` (already defined in constants.go)
2024-03-04 00:32:14 +08:00
Daniel Liu
928a0691ca implement EIP-3198 2024-03-01 15:04:32 +08:00
lmittmann
b36678f7ad core/vm: performance tweak of OpCode.String() (#28453)
make `opCodeToString` a `[256]string` array

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
2024-03-01 14:13:24 +08:00
Leon
8b6db6d87a core/vm: better handle error on eip activation check (#25131)
* core/vm: correct logic for eip check of NewEVMInterpreter

* refactor
2024-03-01 14:13:24 +08:00
Qian Bin
032b98e942 core/vm: optimize Memory.Set32 (#24847)
* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32
2024-03-01 14:13:24 +08:00
s7v7nislands
62b62da730 core/vm: separate opcode group for 0x20 range (#24850) 2024-03-01 14:13:24 +08:00
s7v7nislands
ac35f0ecec core/vm: clean up some dead functions (#24851) 2024-03-01 14:13:24 +08:00
Andrei Maiboroda
b022ba2c5d core/vm: make INVALID a defined opcode (#24017)
* core/vm: Define 0xfe opcode as INVALID

* core/vm: Remove opInvalid as opUndefined handles it

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2024-03-01 14:13:24 +08:00
Paweł Bylica
6e92486296 core/vm: reverse bit order in bytes of code bitmap (#24120)
* core/vm: reverse bit order in bytes of code bitmap

This bit order is more natural for bit manipulation operations and we
can eliminate some small number of CPU instructions.

* core/vm: drop lookup table
2024-03-01 14:13:24 +08:00
Alex Beregszaszi
2ce30010bc core/vm: remove unused code (IsStaticJump) (#24085) 2024-03-01 14:13:24 +08:00
Martin Holst Swende
fbc1cc11ba core/vm: remove no-recursion option from config (24066) 2024-03-01 14:13:24 +08:00
Andrei Maiboroda
4c27910a77 core/vm: move interpreter interruption check to jump instructions (#24026)
* core/vm: Remove interpreter loop interruption check

* core/vm: Unit test for interpreter loop interruption

* core/vm: Check for interpreter loop abort on every jump
2024-03-01 14:13:24 +08:00
Paweł Bylica
7d3c783bb9 core/vm: fill gaps in jump table with opUndefined (#24031) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
ae267d3da7 core/vm: remove stack.pushN (#24040) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
b1c03864e6 core/vm: rename opSuicide to opSelfdestruct (#24022)
The opcode was renamed in the codebase in 2017, but the functions were kept unchanged.
2024-03-01 14:13:24 +08:00
Alex Beregszaszi
bfbb678309 core/vm: move interpreter.ReadOnly check into the opcode implementations (#23970)
* core/vm: Move interpreter.ReadOnly check into the opcode implementations

Also remove the same check from the interpreter inner loop.

* core/vm: Remove obsolete operation.writes flag

* core/vm: Capture fault states in logger

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: Remove panic added for testing

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-01 14:13:24 +08:00
Andrei Maiboroda
002be52ae9 core/vm: don't copy JumpTable when no EIP mods are needed (#23977) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
c097e565fd core/vm: rename SHA3 instruction to KECCAK256 (#23976)
This was proposed in 2016, Solidity uses this since 2017, and evmone and other VMs use the keccak256 name. This brings geth in line with those.
2024-03-01 14:13:24 +08:00
Paweł Bylica
823ec33484 core/vm: simplify error handling in interpreter loop (#23952)
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
2024-03-01 14:13:24 +08:00
Andrei Maiboroda
6415934da9 core/vm: simplify op lookup in contract (#23974) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
f7c6b1abd4 core/vm, core/state/snapshot: remove unused code (#23956)
* core/state/snapshot: remove wiper functionality

* core/vm: remove unused 'unofficial' opcodes
2024-03-01 14:13:23 +08:00
Paweł Bylica
3d3cc6c6d7 core/vm: use proper JumpTable type (#23967) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
f9e14af6fd core/vm: don't use iota for opcode definitions (#23928) 2024-03-01 14:13:23 +08:00
Paweł Bylica
dc8cdf3e62 core/vm: rework jumpdest analysis benchmarks (#23499)
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
2024-03-01 14:13:23 +08:00
Guillaume Ballet
f05fa009e2 core/vm: fix typo in comment (#23450) 2024-03-01 14:13:23 +08:00
Daniel Liu
7a55b9f788 core/state: remove unused methods ReturnGas (#23092) 2024-03-01 14:13:23 +08:00
Evgeny Danilenko
21bbe5f568 core/vm: avoid duplicate log in json logger (#22825) 2024-03-01 14:13:23 +08:00
aaronbuchwald
7c6908b959 core/vm: fix interpreter comments (#22797)
* Fix interpreter comment

* Fix comment
2024-03-01 14:13:23 +08:00
Paweł Bylica
9c8d228dda core/vm: clean up contract creation error handling (#22766)
Do not keep separate flag for "max code size exceeded" case, but instead
assign appropriate error for it sooner.
2024-03-01 14:13:23 +08:00
aaronbuchwald
6077ecb195 core/vm: replace repeated string with variable in tests (#22774) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
446b9e86f4 core/vm, params: make 2200 in line with spec (#21605) 2024-03-01 14:13:23 +08:00
Péter Szilágyi
06d5da016c core/vm: use pointers to operations vs. copy by value (#21336) 2024-03-01 14:13:23 +08:00
Paweł Bylica
192edc0c63 core/vm: use uint256 in EVM implementation (#20787)
* core/vm: use fixed uint256 library instead of big

* core/vm: remove intpools

* core/vm: upgrade uint256, fixes uint256.NewFromBig

* core/vm: use uint256.Int by value in Stack

* core/vm: upgrade uint256 to v1.0.0

* core/vm: don't preallocate space for 1024 stack items (only 16)

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-01 14:13:23 +08:00
Daniel Liu
3f10de24b0 core/vm/privacy: fix test case in ringct_test.go (#424) 2024-02-19 10:52:33 +08:00
Liam
9eea134daa
Merge pull request #424 from gzliudan/RIN-07
check parameters not to be nil when call function curve.Add
2024-02-12 22:23:34 +11:00
Wanwiset Peerapatanapokin
b272e7418c
Fix curve (#429)
* update secp256k1 library from go-eth code

* cast deprecated functions to use new BitCurve type

* add IsOnCurve checks and tests

* add test outcome check

* fix test
2024-02-11 15:59:28 +04:00
Wanwiset Peerapatanapokin
30581274a1
RIN-08 RIN-10 RIN-11 Fix curve issues (#425)
* update secp256k1 library from go-eth code

* cast deprecated functions to use new BitCurve type

* add IsOnCurve checks and tests

* add test outcome check
2024-02-11 01:51:11 +04:00
Banana-J
f453ce8315
fix: missing validation in scalar range check (#417) 2024-02-09 19:56:27 +11:00
Daniel Liu
d440d1d2c6 not pass nil parameters to function curve.Add 2024-02-08 14:50:44 +08:00
Banana-J
ea7d5cc9ad
fix: remove unnecesasry int conversion in the bulletproof.go (#419)
Co-authored-by: wjrjerome <wjrjerome@babylonchain.io>
2024-02-06 22:13:28 +11:00
Liam
fea90a97df
RIN-02 Panic Due to Integer Overflow in Signature Size Calculation (#401)
* RIN-02 Panic Due to Integer Overflow in Signature Size Calculation

* assert the error

* simply overflow check

* simply overflow check

---------

Co-authored-by: Liam Lai <liam.lai@datameshgroup.com>
2024-02-03 10:02:14 +08:00
Banana-J
0664e9fc47
chore: remove the unused false return value from GetCollaterals method (#410) 2024-01-29 11:31:10 +11:00
Banana-J
d70c15667b
chore: remove the unused method in ringct.go (#411) 2024-01-29 11:31:02 +11:00
Banana-J
cac03bd960
fix: GenNewKeyRing should return out of bound error if s and ring size equal in value (#412) 2024-01-29 11:27:48 +11:00
Banana-J
743fc8500b
chore: return statement optimization (#406) 2024-01-28 16:58:41 +11:00
Banana-J
2504961a33
fix: replace all time.after with the time.newtimer (#400) 2024-01-27 21:01:24 +11:00