Commit Graph

47 Commits

Author SHA1 Message Date
Alex Sharov
aa3a804757 fix nil-ptr in txpool fee calc (#9410)
```
[INFO] [02-08|22:58:28.974] new subscription to logs established
[INFO] [02-08|22:58:28.975] rpc filters: subscribing to Erigon events
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x240 pc=0x122572f]

goroutine 2343 [running]:
github.com/ledgerwatch/erigon/consensus/misc.eip1559Calculator.CurrentFees({}, 0xc046591900, {0x7f1202466db8, 0xc0341b7d40})
        github.com/ledgerwatch/erigon/consensus/misc/eip1559.go:80 +0xcf
github.com/ledgerwatch/erigon-lib/txpool.(*TxPool).fromDB(0xc000936c80, {0x3277f60, 0xc000cd8eb0}, {0x3299818?, 0xc0341b7ce0}, {0x3299818?, 0xc0341b7d40?})  
        github.com/ledgerwatch/erigon-lib@v1.0.0/txpool/pool.go:2095 +0x8b3
github.com/ledgerwatch/erigon-lib/txpool.(*TxPool).Start.func1({0x3299818, 0xc0341b7ce0})
        github.com/ledgerwatch/erigon-lib@v1.0.0/txpool/pool.go:329 +0xfe
github.com/ledgerwatch/erigon-lib/kv/mdbx.(*MdbxKV).View(0x29e8d60800?, {0x3277f60?, 0xc000cd8eb0?}, 0xc03412f7a0)
        github.com/ledgerwatch/erigon-lib@v1.0.0/kv/mdbx/kv_mdbx.go:749 +0xa6
github.com/ledgerwatch/erigon-lib/txpool.(*TxPool).Start(0xc000936c80, {0x3277f60?, 0xc000cd8eb0}, {0x328d2d0, 0xc0161ad0a0})
        github.com/ledgerwatch/erigon-lib@v1.0.0/txpool/pool.go:319 +0xc9
github.com/ledgerwatch/erigon-lib/txpool.MainLoop({0x3277f60?, 0xc000cd8eb0}, {0x328d2d0, 0xc0161ad0a0}, 0xc000936c80, 0xc0340750e0, 0xc017e1e0a0, 0xc034088c60, 0xc03459f190)
        github.com/ledgerwatch/erigon-lib@v1.0.0/txpool/pool.go:1729 +0x205
created by github.com/ledgerwatch/erigon/eth.New
        github.com/ledgerwatch/erigon/eth/backend.go:718 +0x3fbd
```
2024-02-14 13:07:22 -06:00
Andrew Ashikhmin
9f1cd651f0
(release) txpool: fix initial blockGasLimit and setBlobFee() (#9303)
Cherry pick PR #9301
2024-01-24 13:33:28 +01:00
Mark Holt
d8b91c4d02
Fix startup sync for txpool processing for bor block production (#9219)
When the sync loop first runs it suppresses block sync events both in
the initial loop and when the blocks being processed are greater than
1000.

This fix removed the first check, because otherwise the first block
received by the process ends up not getting sent to the tx pool. Which
means it won't produce new block for polygon.

As well as this fix - I have also moved the gas initialization to the
txpool start method rather than prompting it with a 'synthetic block
event'

As the txpool start has access to the core & tx DB's it can find the
current block and chain config internally so that it doesn't need to be
externally activated it can just do this itself on start up. This has
the advantage of making the txpool more self contained.
2024-01-13 10:33:34 +00:00
battlmonstr
9c47cce62c
bor: move to polygon directory (#9174) 2024-01-09 19:20:42 +01:00
battlmonstr
b57cbdcff7
polygon/sync: canonical chain builder (#9117) 2024-01-04 10:44:57 +01:00
Andrew Ashikhmin
8288dcb5c2
erigon-lib: remove unused constants from protocol.go (#8644) 2023-11-03 10:20:36 +01:00
Andrew Ashikhmin
b60642fa5a
Configure EIP-4844 parameters for Gnosis (#8464)
See https://github.com/gnosischain/specs/pull/20 &
https://github.com/gnosischain/specs/pull/24
2023-10-13 11:43:16 +02:00
Andrew Ashikhmin
e62e131a8e
Verify excessBlobGas (EIP-4844) (#8269) 2023-09-22 11:52:33 +02:00
Andrew Ashikhmin
1fd9d20e14
EIP-4788 v2 (no precompile) (#8038)
See https://github.com/ethereum/EIPs/pull/7456 &
https://github.com/ethereum/go-ethereum/pull/27849. Also set the gas
limit for system calls to 30M (previously 2^64-1), which is in line with
the [Gnosis
spec](https://github.com/gnosischain/specs/blob/master/execution/withdrawals.md#specification),
but should be doubled checked for Gnosis Chain.
2023-08-24 17:10:50 +02:00
Andrew Ashikhmin
83d767c861
Revert "EIP-4788: set nonce of beacon root history address to nonzero… (#8055)
[devnet-8](https://notes.ethereum.org/@ethpandaops/dencun-devnet-8)
doesn't include https://github.com/ethereum/EIPs/pull/7431 since it's
rendered obsolete by upcoming https://github.com/ethereum/EIPs/pull/7456
(to be implemented by PR #8038).

This reverts PR #7952.
2023-08-23 15:40:49 +02:00
Andrew Ashikhmin
50579425d2
Introduce VerifyAbsenceOfCancunHeaderFields (#7953) 2023-08-02 09:34:30 +02:00
Andrew Ashikhmin
e4612fd6e6
EIP-4788: set nonce of beacon root history address to nonzero (#7952)
See https://github.com/ethereum/EIPs/pull/7431
2023-08-01 16:15:12 +02:00
Somnath Banerjee
d91f4263dc
EIP-4788: Beacon block root and stateful precompile (#7888) 2023-08-01 16:01:26 +05:30
Andrew Ashikhmin
7d35c6b737
EIP-4844: Rename "data gas" to "blob gas" (#7937)
See https://github.com/ethereum/EIPs/pull/7354 &
https://github.com/ethereum/consensus-specs/pull/3461. Prerequisite:
https://github.com/ledgerwatch/erigon-lib/pull/1058
2023-07-28 12:12:05 +02:00
Andrew Ashikhmin
a24eae8d6c
EIP-4844: Handle data gas in txpool (#7779)
Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/1029
2023-06-23 11:10:23 +02:00
Somnath Banerjee
71231140a5
Block Gas limit contract integration for Chiado (#7727)
Changes summary:
- Continue with the gasLimit check skip in ``verifyHeader`` of
``merge.go`` for unless pre-merge block and blockGasLimitContract
present
- Refactor ``aura.go`` a bit
- Have ``sysCall`` method customized to be able to call state (contract)
at a parent (or any other) header state
2023-06-19 22:06:51 +05:30
Andrew Ashikhmin
190bc9dfd8
EIP-4844: add data_gas_used (#7639)
Implement https://github.com/ethereum/EIPs/pull/7062 and
https://github.com/ethereum/EIPs/pull/7095. Pick up
https://github.com/ledgerwatch/erigon-lib/pull/1006.
2023-06-02 21:26:19 +01:00
Andrew Ashikhmin
319e99e72a
Skip gas limit checks for chains with gas limit contract (#7567)
Dirty hack to fix Chiado until #7151 is properly implemented. Should fix
the following error:
```
[WARN] [05-23|17:07:39.303] Verification failed for header           hash=0x4eee718e5958a862746ea9a9531a16e6a404698d3a0e8120e8aff743b9f1e0a2 height=1 err="invalid gas limit: have 12500000, want 10000000 +-= 9764"
```
2023-05-23 22:14:18 +02:00
racytech
36e70c545b
eip-4844: data gas fees & related check (#7449)
Logic to compute fees for data blobs as well as additional check that
verifies if user was willing to pay the current `data_gas` price.
Updated `FakeExponential` function to work with uint256.
2023-05-08 12:20:10 +07:00
racytech
6588bca40b
eip-4844: NewMessage now expectes maxFeePerDataGas & GetPayloadV3 impl (#7365)
types.NewMessage now expects maxFeePerDataGas param, which will be used
in transaction verification (preCheck). GetPayloadV3 method added to
EngineAPI. Some cosmetic changes applied.
2023-04-23 18:27:05 +01:00
racytech
70bc7f7a25
eip-4844: small additions and modified gaspool (#7190)
This PR contains very small EIP-4844 additions. GasPool is modified and
now it is a struct with 2 fields "gas" and "dataGas" (blobs are priced
in dataGas). ExcessDataGas block header field added. ExcessDataGas
needed to compute the data gas price. EIP-4844 helper functions are
added as well.
2023-03-27 21:39:15 +00:00
Andrew Ashikhmin
3270720cb7
Remove ETC-specific DAOForkSupport=false functionality (#7075) 2023-03-10 12:10:11 +00:00
Andrew Ashikhmin
2212e21192
Remove archaic eip150Hash functionality (#7074) 2023-03-10 10:55:59 +00:00
Andrew Ashikhmin
1dab298db7
Add Prague fork support (#7005)
Prague is the next EL fork after
[Cancun](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md).
This change picks up https://github.com/ledgerwatch/erigon-lib/pull/913,
adds support of the fork, and moves Verkle trees to it.
2023-03-02 17:51:36 +00:00
Alex Sharov
b99e4abb3e
move math big constants to erigon-lib (#6719) 2023-01-27 11:39:34 +07:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00
Manav Darji
80e29f29d3
sprint length and base fee denominator change for mumbai testnet (#6142)
This PR includes changes required for delhi hard fork schedule at block
`29638656` on mumbai testnet. It changes few major parameters.

1. Sprint length - the number of bor blocks post which a new validator
mines has been reduced from 64 to 16.
2. Block time - the block time which was increased earlier for some
experiments to 5 seconds has been reduced to 2 seconds (along with
backup multiplier and producer delay).
3. Base fee denominator - this fields has been increased from 8 to 16 to
smoothen the effect of EIP 1559.
2022-11-29 08:11:29 +07:00
Andrew Ashikhmin
4b55358bde
Fix Gnosis Chain fork ID (#5487) 2022-09-23 12:26:35 +02:00
Andrew Ashikhmin
7561a74af3
Remove terminal PoW block overrides (#5420) 2022-09-19 10:33:18 +02:00
Levi Aul
600837a23f
Apply BSC Gibbs upgrade (for Chapel, Rialto) (#5359) 2022-09-13 22:34:02 +03:00
Andrew Ashikhmin
7f83bef559
Add support for Shanghai & Cancun blocks (#5255) 2022-09-01 17:37:53 +02:00
Alex Sharov
351cd49c21
go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
Andrew Ashikhmin
92b1f06932
Gray Glacier bomb delay (#4443) 2022-06-14 10:48:40 +01:00
Andrew Ashikhmin
86de64a2a3
TangerineWhistle instead of EIP150 & SpuriousDragon instead of EIP155/158 (#4273)
* EIP150Block -> TangerineWhistleBlock

* Merge EIP158Block into EIP155Block

* EIP155Block -> SpuriousDragonBlock
2022-05-26 12:08:59 +02:00
Andrew Ashikhmin
1214302a19
Arrow Glacier network upgrade (#2896) 2021-10-31 20:31:18 +07:00
ledgerwatch
74862ce607
Upgrade tests to 9.0.2 (#2147)
* Upgrade tests to 9.0.1

* Fix gas limit rule

* Clean up output

* Update testdata

* Fix tip assigment

* Fix genesis discrepancy

* Skip typeTwo berlin test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-06-13 14:01:11 +01:00
Alex Sharov
0be3044b7e
rename (#1978)
* rename

* rename "make grpc"

* rename "abi bindings templates"

* rename "abi bindings templates"
2021-05-20 19:25:53 +01:00
ledgerwatch
447f20d395
Baikal testnet configuration (#1910)
* Baikal testnet configuration

* Fixes

* Change AsMessage signature

* Fixes in t8ntool

* More updates

* Fix misspelling

* Skip eip1559 transition test

* More bootnodes

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-05-11 10:54:20 +01:00
ledgerwatch
12cde41772
Aleut support (Eip1559) (#1704)
* Where I am at

* Refactoring of transaction types

* More refactoring

* Use Homested signer in rpc daemon

* Unified signer

* Continue unified signer

* A bit more

* Fixes and down the rabbit hole...

* More tx pool fixes

* More refactoring fixes

* More fixes'

* more fixes

* More fixes

* More compile fixes

* More RLP hand-writing

* Finish RLP encoding/decoding of transactions

* Fixes to header encoding, start on protocol packets

* Transaction decoding

* Use DecodeTransaction function

* Decoding BlockBodyPacket

* Encode and decode for pool txs

* Start fixing tests

* Introduce SigningHash

* Fixes to SignHash

* RLP encoding fixes

* Fixes for encoding/decoding

* More test fixes

* Fix more tests

* More test fixes

* More test fixes

* Fix core tests

* More fixes for signer

* Fix for tx

* Fixes to string encoding/size

* Fix eip2930 test

* Fix rest of ./tests

* More fixes

* Fix compilation

* More test fixes

* More test fixes

* Test fixes

* More fixes

* Reuse EncodingSize in EncodeRLP for accessList

* Rearrange things in dynamic fee tx

* Add MarshalBinary

* More fixes

* Make V,R,S non-pointers

* More NPE fixes

* More fixes

* Receipt fixes

* Fix core/types

* Fix ./eth

* More compile fixes for tests

* More test fixes

* More test fixes

* Try to see lint errors better

* Try to see lint errors better

* Fix lint

* Debugging eip1559 test

* Fix TestEIP1559Transition test

* Fix NewBlockPacket encoding/decoding

* Fix calculation of TxHash

* Fix perf problem with senders

* Update aleut config values

* Try adding static peers

* Add staticpeers to defaul flags

* Change aleut networkID

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-04-22 18:11:37 +01:00
ledgerwatch
b743b88218
Revert "Extract validating interface (#1120)" (#1543)
* Revert "Extract validating interface (#1120)"

This reverts commit e4e36c152e.

* Fix go mod tidy

* Fix lint

* Fix lint

* fix lint

* Test fix

* Fix test

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-03-05 20:34:23 +00:00
Evgeny Danilenko
e4e36c152e
Extract validating interface (#1120)
* interface

* generalize interface

* linters

* fix deadlock

* fix linters

* close goroutine

* fix

* debug

* id+ttl

* refactor downloader tests

* tests

* lru

* handle genesis, extract fake consensuses

* fix fake consensus

* test uncles, verify

* after a new master

* fmt

* fix close

* debug

* debug

* fix chain length

* remove test field

* use single account

* fix data race on closing channel

* remove postponed blocks queue

* miner test

* VerifyHeaderRequests

* fmt

* fmt

* fix data race

* handle validating errors

* simplify matchParents

* remove copy-paste

* move sort to constructor

* clean up

* debug for 10 parents

* debug

* debug

* batch responses

* batch requests

* works for many ancestors

* remove debug

* always Close an engine

* linters

* ancestors deduplication

* fix test

* reduce interface

* api

* clique

* green clique sync

* stable

* perpermance per second

* full sync

* linters

* gitignore

* deps

* fix panic after master merge

* init consensus

* clique tests

* fix tests

* fix tests

* clean up

* reuse snap

* store vefified snapshots

* optimize snapshots

* safe close

* cleanup loop

* after downloader

* downloader and consensus tests

* update tests

* hack.go

* clique flags

* fix cliuqe config

* review

* gitignore

* remove additional bucket

* blk/sec instead of blk/microsecond

* rename

* deps

* optimize

* debug

* test

* tests without extracted validation process

* same base performance as on master

* benchmark

* simplify ethash verification

* ethash

* ethash

* linters

* ethash

* master stats

* cleanup

* gomod

* linters

* tests

* better locks

* Fix

* Remove logging for verifyHeaders

* Verification speed in the logs

* Fix compile error

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-02-25 19:40:45 +00:00
Martin Michlmayr
732a20d468 all: fix typos in comments (#21118)
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/puppeth/module_dashboard.go
#	core/blockchain_test.go
#	core/rawdb/chain_iterator.go
#	core/state/snapshot/difflayer.go
#	core/state/snapshot/iterator.go
#	core/state/snapshot/iterator_fast.go
#	core/state/snapshot/snapshot.go
#	core/state/snapshot/wipe.go
#	core/tx_pool.go
#	les/clientpool.go
#	les/peer.go
#	mobile/doc.go
#	trie/committer.go
#	trie/database.go
2020-06-15 19:38:13 +03:00
Andrew Ashikhmin
5bbdb6a4b9
Use uint256 for account balance (#580)
* Use uint256 for account balance

* linter
2020-05-26 17:53:50 +01:00
Alexey Akhunov
fe01bccbb8 Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
S. Matthew English
061889d4ea rlp, trie, contracts, compression, consensus: improve comments (#14580) 2017-06-12 14:45:17 +02:00
Péter Szilágyi
09777952ee core, consensus: pluggable consensus engines (#3817)
This commit adds pluggable consensus engines to go-ethereum. In short, it
introduces a generic consensus interface, and refactors the entire codebase to
use this interface.
2017-04-05 00:16:29 +02:00