Commit Graph

1923 Commits

Author SHA1 Message Date
Martin Holst Swende
526c3f6b9e
core/state/snapshot: fix benchmarks (#23804) 2021-10-26 11:01:01 +02:00
meowsbits
c72b16c340
core: use block difficulty for genesis (#23793)
* core: write test showing that TD is not stored properly at genesis

The ToBlock method applies a default value for an empty
difficulty value. This default is not carried over through the Commit
method because the TotalDifficulty database write writes the
original difficulty value (nil) instead of the defaulty value
present on the genesis Block.

Date: 2021-10-22 08:25:32-07:00
Signed-off-by: meows <b5c6@protonmail.com>

* core: write TD value from Block, not original genesis value

This an issue where a default TD value was not written to
the database, resulting in a 0 value TD at genesis.

A test for this issue was provided at 90e3ffd393

Date: 2021-10-22 08:28:00-07:00
Signed-off-by: meows <b5c6@protonmail.com>

* core: fix tests by adding GenesisDifficulty to expected result

See prior two commits.

Date: 2021-10-22 09:16:01-07:00
Signed-off-by: meows <b5c6@protonmail.com>

* les: fix test with genesis change

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-10-26 08:44:43 +02:00
Martin Holst Swende
0e7efd696b
core/rawdb, ethdb: introduce batched/atomic reads from ancients (#23566)
This PR adds a new accessor method to the freezer database. This new view offers a consistent interface, guaranteeing that all individual tables (headers, bodies etc) are all on the same number, and that this number is not changes (added/truncated) while the operation is performing.
2021-10-25 16:24:27 +02:00
Ziyuan Zhong
312e02bca9
core/state/snapshot: fix BAD BLOCK error when snapshot is generating (#23635)
* core/state/snapshot: fix BAD BLOCK error when snapshot is generating

* core/state/snapshot: alternative fix for the snapshot generator

* add comments and minor update

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-10-20 10:05:27 +02:00
Marius van der Wijden
c641cff51a
core: refactored blockchain.go (#23735) 2021-10-18 10:45:59 +03:00
rjl493456442
f915f6873f
core/state/snapshot: fix data race in layer flattening (#23628)
* core/state/snapshot: fix data race in layer flattening

* core/state/snapshot: fix typo
2021-10-15 10:52:40 +03:00
jwasinger
011fe3eb5e
core: remove unused error from TxPool.Pending (#23720) 2021-10-13 23:00:45 +02:00
Iskander (Alex) Sharipov
778ff94794
all: fix some go-critic linter warnings (#23709)
This doesn't fix all go-critic warnings, just the most serious ones.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-10-13 17:31:02 +02:00
Ian Norden
e4f570fcc6
core/types: add MarshalBinary, UnmarshalBinary for Receipt (#22806) 2021-10-13 15:16:16 +02:00
Martin Holst Swende
6289137827
consensus/clique, core: API cleanup (#23100)
This removes some code:

- The clique engine calculated the snapshot twice when verifying headers/blocks.

- The method GetBlockHashesFromHash in Header/Block/Lightchain was only used by tests. It
  is now removed from the API.
  
- The method GetTdByHash internally looked up the number before calling GetTd(hash, num).
  In many cases, callers already had the number, and used this method just because it has a
  shorter name. I have removed the method to make the API surface smaller.
2021-10-11 23:16:46 +02:00
Miro
cf8a6d6173
core: tests for forked blocks retrievable by hash (#23695)
* Update tests to showcase that forked blocks can still be looked up by their hash
2021-10-11 19:25:21 +02:00
hsyodyssey
84bccd0900
core/state: fix typos in comments (#23702) 2021-10-10 15:00:00 +02:00
Martin Holst Swende
edb1937cf7
core: improve shutdown synchronization in BlockChain (#22853)
This change removes misuses of sync.WaitGroup in BlockChain. Before this change,
block insertion modified the WaitGroup counter in order to ensure that Stop would wait
for pending operations to complete. This was racy and could even lead to crashes
if Stop was called at an unfortunate time. The issue is resolved by adding a specialized
'closable' mutex, which prevents chain modifications after stopping while also
synchronizing writers with each other.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-10-07 15:47:50 +02:00
aaronbuchwald
4e599ee469
core/types: copy tx recipient address (#23376)
This resolves a long-standing TODO. The point of copying the address is
to ensure that all data referenced by types.Transaction is independent of the
data passed into the constructor.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-10-06 13:12:52 +02:00
hsyodyssey
12f971fb2d
core/state: fix typo in comment (#23665) 2021-10-04 12:16:50 +02:00
Ikko Ashimine
f2491c5ed7
core: fix typo in comment (#23658) 2021-09-29 21:28:47 +02:00
Sina Mahmoodi
783e97ef1f
core/rawdb: avoid unnecessary receipt processing for log filtering (#23147)
* core/types: rm extranous check in test

* core/rawdb: add lightweight types for block logs

* core/rawdb,eth: use lightweight accessor for log filtering

* core/rawdb: add bench for decoding into rlpLogs
2021-09-28 12:54:49 +02:00
Guillaume Ballet
443afc975c
core/state: move state account to core/types + abstracted "write account to trie" (#23567)
* core/state: abstracted "write account to trie" method

* fix appveyor build

* Apply suggestions from code review

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

* review feedback

* core/state/accounts: move Account to core/types

* core/types: rename Account -> StateAccount

* core/state: restore EncodeRLP for stateObject

* core/types: add the missing file

* more review feedback

* more review feedback

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-09-28 10:48:07 +02:00
Marius van der Wijden
b61ef24cce
consensus/clique: prevent 0 len extradata from panicing (#23538)
Closes #23522

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-09-21 10:46:08 +02:00
Sina Mahmoodi
401354976b
core,eth: call frame tracing (#23087)
This change introduces 2 new optional methods; `enter()` and `exit()` for js tracers, and makes `step()` optiona. The two new methods are invoked when entering and exiting a call frame (but not invoked for the outermost scope, which has it's own methods). Currently these are the data fields passed to each of them:

    enter: type (opcode), from, to, input, gas, value
    exit: output, gasUsed, error

The PR also comes with a re-write of the callTracer. As a backup we keep the previous tracing script under the name `callTracerLegacy`. Behaviour of both tracers are equivalent for the most part, although there are some small differences (improvements), where the new tracer is more correct / has more information.
2021-09-17 09:31:22 +02:00
Marius van der Wijden
b8d7c662cd
core, rpc: disable memory output by default in traces (#23558)
* core: cmd: invert disableMemory

* core: fix missed inversion

* cmd/evm: preserve Flags but change default value

* Apply suggestions from code review

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

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-09-13 18:59:52 +02:00
Felix Lange
5c1fc3bf54
core: 64bit alignment of testBlockChain.gasLimit (#23543)
This fixes crashes in txpool tests on 32bit platforms.
2021-09-07 18:54:15 +03:00
Felix Lange
51ed39c093
core: make txPricedList.stales the first field for 64bit alignment (#23542)
This fixes crashes on 32bit builds.
2021-09-07 17:15:11 +03:00
Martin Holst Swende
794c6133ef
core/rawdb: freezer batch write (#23462)
This change is a rewrite of the freezer code.

When writing ancient chain data to the freezer, the previous version first encoded each
individual item to a temporary buffer, then wrote the buffer. For small item sizes (for
example, in the block hash freezer table), this strategy causes a lot of system calls for
writing tiny chunks of data. It also allocated a lot of temporary []byte buffers.

In the new version, we instead encode multiple items into a re-useable batch buffer, which
is then written to the file all at once. This avoids performing a system call for every
inserted item.

To make the internal batching work, the ancient database API had to be changed. While
integrating this new API in BlockChain.InsertReceiptChain, additional optimizations were
also added there.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-09-07 12:31:17 +02:00
Marius van der Wijden
067084feda
core: fix race conditions in txpool (#23474)
* core: fix race conditions in txpool

* core: fixed races in the txpool

* core: rebased on master

* core: move reheap mutex

* core: renamed mutex

* core: revert Reheap changes
2021-08-31 10:33:39 +02:00
Ikko Ashimine
31be5d41d9
core: fix typo in iterator.go (#23502)
strorage -> storage
2021-08-31 10:21:42 +02:00
Paweł Bylica
3258211f68
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
2021-08-30 14:13:06 +02:00
Felix Lange
8a134014b4
all: add go:build lines (#23468)
Generated by go1.17 fmt ./...
2021-08-25 18:46:29 +02:00
gary rong
a5a5237178
core, light, tests, trie: add state metrics (#23433) 2021-08-24 22:00:42 +03:00
Martin Holst Swende
d705f5a554
core: make txpool reject too sudden changes (#23095)
* core: make txpool reject too sudden changes

* core: add some metrics to txpool
2021-08-24 21:48:36 +03:00
Martin Holst Swende
a0a4a153e9
core/types: add benchmarks for rlp encoding/decoding (#23190)
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
2021-08-24 13:59:15 +02:00
Guillaume Ballet
0b40977480
core/vm: fix typo in comment (#23450) 2021-08-24 13:57:05 +02:00
Pedro Gomes
8e0771c218
core/bloombits: avoid crash when storing errors of different type (#23437)
This fixes a rare crash which could occur when two different errors happened
in the same bloombits.MatcherSession.
2021-08-24 13:32:19 +02:00
Martin Holst Swende
1d99573192
core/vm: faster code analysis (#23381)
* core/vm: more detailed benchmark for jumpdest analysis

* core/vm: make jd analysis benchmark alloc free

* core/vm: improve jumpdest analysis

* core/vm: improve worst-case

* core/vm: further improvements in analysis

* core/vm: improve jumpdest analysis >PUSH15

* core/vm: make jd analysis ref by value

* core/vm: fix misspell

* core/vm: improve set8 and set16 a bit

* core/vm: reduce amount of code

* core/vm: optimize byte copying
2021-08-24 10:00:10 +03:00
Marius van der Wijden
d02c605367
core: only check sendernoeoa in non fake mode (#23424) 2021-08-23 12:49:39 +03:00
chuwt
5566e5d152
eth/downloader: fix typo in comment (#23413) 2021-08-18 13:03:41 +03:00
Zachinquarantine
85b9bdd641
cmd, core: remove calaveras testnet (#23366)
Removes references to the short-lived Calaveras testnet
2021-08-17 18:43:25 +02:00
Martin Holst Swende
5f98020a21
core/rawdb: implement sequential reads in freezer_table (#23117)
* core/rawdb: implement sequential reads in freezer_table

* core/rawdb, ethdb: add sequential reader to db interface

* core/rawdb: lint nitpicks

* core/rawdb: fix some nitpicks

* core/rawdb: fix flaw with deferred reads not being performed

* core/rawdb: better documentation
2021-08-13 11:51:01 +03:00
Péter Szilágyi
9d6480c3cd
core/state/snapshot: gofmt 2021-08-10 16:58:38 +03:00
Tyler Chambers
66948316f7
core/state/snapshot: clarify comment about snapshot repair (#23305)
Co-authored-by: Tyler Chambers <me@tylerchambers.net>
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-08-10 11:16:53 +02:00
Ziyuan Zhong
57d9e0ac75
core/state/snapshot: fix typo in comment (#23219) 2021-08-10 11:04:29 +02:00
gary rong
6d175460df
cmd, core, eth, miner: deprecate miner.gastarget flag (#23213) 2021-08-10 11:28:33 +03:00
Péter Szilágyi
3b38a83274
core/state/pruner: fix state bloom sync permission in Windows 2021-08-10 10:40:10 +03:00
shawn
d60cfd2604
core: fix london-check to avoid duplication (#23333)
Co-authored-by: lxex <liuxmzc1@163.com>
2021-08-09 16:34:20 +02:00
Shihao Xia
9e59474e46
core/rawdb: close database in test to avoid goroutine leak (#23287)
* add db close to avoid goroutine leak

* core/rawdb: move close to defer

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-08-08 15:44:42 +02:00
Martin Holst Swende
0658712f65
core: check if sender is EOA (#23303)
This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
2021-08-07 19:38:18 +02:00
Patrick O'Grady
d3e3a460ec
core/rawdb: fix logs to print block number, not address (#23328) 2021-08-04 11:10:37 +03:00
Marius van der Wijden
28ba686cbf
core/state: add trie prefetcher tests (#23216)
* core/state: add trie prefetcher tests

* core/state: add missing license
2021-08-03 17:35:25 +02:00
Sina Mahmoodi
c38fab912b
core: get header from block cache (#23299) 2021-08-03 17:29:47 +02:00
aaronbuchwald
82c5085399
cre/state: fix outdated statedb Prepare comment (#23320) 2021-08-03 09:06:58 +03:00
baptiste-b-pegasys
3526f69047
all: remove term "whitelist" in comments and log messages (#23294) 2021-07-29 17:36:15 +02:00
baptiste-b-pegasys
523866c2cc
all: change blacklist terms 2021-07-29 11:17:40 +03:00
Marius van der Wijden
2faf796d2a
internal/ethapi: fix panic in accesslist creation (#23225)
* internal/ethapi: revert + fix properly in al tracer

* internal/ethapi: use toMessage instead of creating new message

* internal/ethapi: remove ineffassign

* core: fix invalid unmarshalling, fix test

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-28 14:21:35 +02:00
gary rong
370680a7a9
core/types: revert removal of legacy receipt support (#23247)
* Revert "core/types: go generate (#23177)"

This reverts commit 00b922fc5d.

* Revert "core/types: remove LogForStorage type (#23173)"

This reverts commit 7522642393.

* Revert "core/types: remove support for legacy receipt/log storage encoding (#22852)"

This reverts commit 643fd0efc6.
2021-07-22 15:43:51 +02:00
Marius van der Wijden
97aacd9b35
core: fix pre-check for account balance under EIP-1559 (#23244)
When processing a transaction with London fork rules, EIP-1559 mandates
checking that the sender must have sufficient balance to cover gas * gasFeeCap.

In the EIP's pseudocode, this check happens after the value transferred by the
transaction has already been deducted. However, in go-ethereum, the balance
has not yet been updated when the check happens, and therefore needs to be
added explicitly.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-22 15:39:40 +02:00
Mark
c49e065fea
internal: get pending and queued transaction by address (#22992)
* core, eth, internal, les, light: get pending and queued transaction by address

* core: tiny nitpick fixes

* light: tiny nitpick

Co-authored-by: mark <mark@amis.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-07-13 13:40:58 +03:00
Marius van der Wijden
8fe47b0a0d
core/state: avoid unnecessary alloc in trie prefetcher (#23198) 2021-07-12 21:34:20 +02:00
Martin Holst Swende
ff4ff30a68
core, params: define london block at 12965000 (#23176)
* core, params: define london block at 12965000

* core/forkid: fix test
2021-07-08 12:34:56 +03:00
ucwong
00b922fc5d
core/types: go generate (#23177) 2021-07-08 07:53:28 +02:00
Sina Mahmoodi
7522642393
core/types: remove LogForStorage type (#23173)
The encoding of Log and LogForStorage is exactly the same
now. After tracking it down it seems like #17106 changed the
storage schema of logs to be the same as the consensus
encoding.

Support for the legacy format was dropped in #22852 and if
I'm not wrong there's no reason anymore to have these two
equivalent types.

Since the RLP encoding simply contains the first three fields
of Log, we can also avoid creating a temporary struct for
encoding/decoding, and use the rlp:"-" tag in Log instead.

Note: this is an API change in core/types. We decided it's OK
to make this change because LogForStorage is an implementation
detail of go-ethereum and the type has zero uses outside of
package core/types.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-07-07 19:52:55 +02:00
Sina Mahmoodi
5441a8fa47
all: remove noop vm config flags (#23111)
* all: rm external interpreter and ewasm config

* core/vm: rm Interpreter interface

* cmd/geth: deprecate interpreter config fields
2021-07-06 22:03:09 +02:00
Péter Szilágyi
e13d14e6a3
core/types: sanity check the basefee length inside a header (#23171) 2021-07-06 22:02:38 +02:00
gary rong
bd566977e8
core: fix bad parent hash when jumping to genesis in setHead (#23162) 2021-07-06 10:32:26 +03:00
Martin Holst Swende
f5f906dd0d
eth/tracers: improve tracing performance (#23016)
Improves the performance of debug.traceTransaction
2021-07-01 09:15:04 +02:00
Marius van der Wijden
686b2884ee
all: removed blockhash from statedb (#23126)
This PR removes the blockhash from the statedb
2021-06-30 15:17:01 +02:00
Martin Holst Swende
2d4eff21ca
eth/downloader: increase downloader block body allowance (#23074)
This change increases the cache size from 64 to 256 Mb for block bodies.
Benchmarks have shown this to be one bottleneck when trying to achieve
higher download speeds.

The commit also includes a minor optimization for header inserts in package
core: previously, the presence of headers in the database was checked for
every header before writing it. With the change, if one header fails the
presence check, all subsequent headers are also assumed to be missing.
This is an improvement because in practice, the headers are almost always
missing during sync.
2021-06-25 14:53:22 +02:00
Li Dongwei
bca8c03e57
core/state: remove unused methods ReturnGas, GetStorageProofByHash (#23092)
Co-authored-by: lidongwei <lidongwei@huobi.com>
2021-06-25 14:34:09 +02:00
Nye Liu
4dde0665c8
core: transaction journal should not be executable (#23090) 2021-06-23 07:29:20 +03:00
Oliver Tale-Yazdi
7b6c8363da
core: copy CliqueConfig in DeveloperGenesisBlock (#23068)
Copy the CliqueConfig instead of reusing the pointer.
This makes DeveloperGenesisBlock thread safe and prevents it from
changing params.AllCliqueProtocolChanges.Clique.Epoch.
2021-06-20 15:52:04 +02:00
Jeff Wentworth
15fe3050a1
core/types: add DynamicFeeTx to TxData implementation list in docs (#23063) 2021-06-17 19:54:37 +02:00
Marius van der Wijden
a675c89c75
core: readded state processor error tests (#23055) 2021-06-16 16:00:36 +03:00
Martin Holst Swende
080b6ebe91
core/vm: evm fix panic (#23047)
* core/vm: evm fix panic

* core/vm/runtime: default to params.initialbasefee
2021-06-16 09:53:27 +03:00
Péter Szilágyi
aa69d36152
core, graphql, internal: expose effectiveGasPrice in receipts 2021-06-16 09:52:06 +03:00
Péter Szilágyi
7a7abe3de8
accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#23038)
* accounts/abi/bind: fix bounded contracts and sim backend for 1559

* accounts/abi/bind, ethclient: don't rely on chain config for gas prices

* all: enable London for all internal tests

* les: get receipt type info in les tests

* les: fix weird test

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-06-15 13:56:14 +03:00
Martin Holst Swende
087ed9c92e
params, core/forkid: add london testnet blocks (#23041)
* params: add london testnet blocks

* core/forkid: update fork hashes
2021-06-14 20:35:01 +03:00
Martin Holst Swende
8a4460c47e
core: change baseFee into baseFeePerGas in genesis json 2021-06-14 14:04:44 +02:00
Péter Szilágyi
ccf53daee1
Merge pull request #23013 from holiman/genesis_fix
core: make genesis parse baseFee correctly
2021-06-14 07:52:33 +03:00
Péter Szilágyi
f68a68a313
core, internal: support various eth_call invocations post 1559 2021-06-10 08:02:51 +03:00
Péter Szilágyi
c503f98f6d
all: rename internal 1559 gas fields, add support for graphql (#23010)
* all: rename internal 1559 gas fields, add support for graphql

* cmd/evm/testdata, core: use public 1559 gas names on API surfaces
2021-06-08 12:05:41 +02:00
Martin Holst Swende
f763846e6e
core: make genesis parse baseFee correctly 2021-06-08 11:07:27 +02:00
Evolution404
248572ee54
core/rawdb: db inspect move 'config' and 'shutdown' into 'meta data' (#22978)
* core/rawdb: db inspect move 'config' and 'shutdown' into 'meta data'

* gofmt
2021-06-08 11:39:24 +03:00
Martin Holst Swende
0e9c7d564d
tests: update for London (#22976)
This updates the tests submodule to the London fork tests, and
also updates the test runner to support the new EIP-1559 fields in
test JSON.
2021-06-07 14:37:56 +02:00
Péter Szilágyi
7e915ee379
core, eth, miner: enforce configured mining reward post 1559 too 2021-06-04 10:18:37 +03:00
Martin Holst Swende
5cff9754d7
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader

* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results

* core,eth,les,internal: add support for tip estimation in gas price oracle

* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap

* core/types,internal: use correct eip1559 terminology for json marshalling

* eth, internal/ethapi: fix rebase problems

* internal/ethapi: fix rpc name of basefee

* internal/ethapi: address review concerns

* core, eth, internal, les: simplify gasprice oracle (#25)

* core, eth, internal, les: simplify gasprice oracle

* eth/gasprice: fix typo

* internal/ethapi: minor tweak in tx args

* internal/ethapi: calculate basefee for pending block

* internal/ethapi: fix panic

* internal/ethapi, eth/tracers: simplify txargs ToMessage

* internal/ethapi: remove unused param

* core, eth, internal: fix regressions wrt effective gas price in the evm

* eth/gasprice: drop weird debug println

* internal/jsre/deps: hack in 1559 gas conversions into embedded web3

* internal/jsre/deps: hack basFee to decimal conversion

* internal/ethapi: init feecap and tipcap for legacy txs too

* eth, graphql, internal, les: fix gas price suggestion on all combos

* internal/jsre/deps: handle decimal tipcap and feecap

* eth, internal: minor review fixes

* graphql, internal: export max fee cap RPC endpoint

* internal/ethapi: fix crash in transaction_args

* internal/ethapi: minor refactor to make the code safer

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 16:13:10 +03:00
Guillaume Ballet
2cde472650
core/state: fix typos in test error message (#22962) 2021-05-31 12:43:18 +02:00
Martin Holst Swende
08ea52e77a
cmd/geth, core, params: replace baikal with calaveras (#22972)
* cmd/geth, core, params: replace baikal with calaveras

* params: fix genesis hash for Calaveras

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-05-31 10:06:48 +03:00
Felföldi Zsolt
2d716c4b01
core: add new eip-1559 tx constraints (#22970)
This PR adds the new consensus constraints of EIP-1559 transactions as specified in https://github.com/ethereum/EIPs#3594
2021-05-30 19:37:52 +02:00
Felföldi Zsolt
966ee3ae6d
all: EIP-1559 tx pool support (#22898)
This pull request implements EIP-1559 compatible transaction pool with dual heap eviction ordering.
It is based on #22791
The eviction ordering scheme and the reasoning behind it is described here: https://gist.github.com/zsfelfoldi/9607ad248707a925b701f49787904fd6
2021-05-28 10:28:07 +02:00
gary rong
c73652da0b
core/state/snapshot: fix flaky tests (#22944)
* core/state/snapshot: fix flaky tests

* core/state/snapshot: fix tests
2021-05-26 10:58:09 +03:00
Fire Man
93407b14a6
core: make txpool free space calculation more accurate (#22933) 2021-05-24 14:34:38 +02:00
Evolution404
81662fe827
core/rawdb: handle prefix in table.compact method (#22911) 2021-05-21 10:33:59 +02:00
Martin Holst Swende
a6c462781f
EIP-1559: miner changes (#22896)
* core/types, miner: create TxWithMinerFee wrapper, add EIP-1559 support to TransactionsByMinerFeeAndNonce

miner: set base fee when creating a new header, handle gas limit, log miner fees

* all: rename to NewTransactionsByPriceAndNonce

* core/types, miner: rename to NewTransactionsByPriceAndNonce + EffectiveTip

miner: activate 1559 for testGenerateBlockAndImport tests

* core,miner: revert naming to TransactionsByPriceAndTime

* core/types/transaction: update effective tip calculation logic

* miner: update aleut to london

* core/types/transaction_test: use correct signer for 1559 txs + add back sender check

* miner/worker: calculate gas target from gas limit

* core, miner: fix block  gas limits for 1559

Co-authored-by: Ansgar Dietrichs <adietrichs@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
2021-05-21 09:59:26 +02:00
Shane Bammel
32c1ed8a9c
core/forkid: fix off-by-one bug (#22879)
* forkid: added failing test

* forkid: fixed off-by-one bug
2021-05-18 11:37:18 +03:00
Evolution404
b7a91663ab
core/asm: fix the bug of "00" prefix number (#22883) 2021-05-18 10:22:58 +02:00
Martin Holst Swende
bb9f9ccf4f
core/rawdb: wait for background freezing to exit when closing freezer (#22878) 2021-05-18 01:30:01 +02:00
Martin Holst Swende
67e7f61af7
core: fix failing tests (#22888)
This PR fixes two errors that regressed when EIP-1559 was merged.
2021-05-18 01:10:28 +02:00
Martin Holst Swende
94451c2788
all: implement EIP-1559 (#22837)
This is the initial implementation of EIP-1559 in packages core/types and core.
Mining, RPC, etc. will be added in subsequent commits.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-05-17 15:13:22 +02:00
Martin Holst Swende
addd8824cf
cmd/geth, eth, core: snapshot dump + unify with trie dump (#22795)
* cmd/geth, eth, core: snapshot dump + unify with trie dump

* cmd/evm: dump API fixes

* cmd/geth, core, eth: fix some remaining errors

* cmd/evm: dump - add limit, support address startkey, address review concerns

* cmd, core/state, eth: minor polishes, fix snap dump crash, unify format

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-05-12 11:05:39 +03:00
Guillaume Ballet
a2c456a526
core: ensure a broken trie invariant crashes genesis creation (#22780)
* Ensure state could be created in ToBlock

* Fix rebase errors

* use a panic instead
2021-05-11 18:12:10 +03:00
Felix Lange
643fd0efc6
core/types: remove support for legacy receipt/log storage encoding (#22852)
* core/types: remove support for legacy receipt storage encoding

* core/types: remove support for legacy log storage encoding
2021-05-11 11:43:35 +03:00