Commit graph

1652 commits

Author SHA1 Message Date
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
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