Commit Graph

1228 Commits

Author SHA1 Message Date
Alex Sharov
a9853d2ef8
Recon parallel: split ReconState to 2 objects to avoid lock contention between .Done() and .Get(), less ram in beginning (#5713) 2022-10-12 17:23:10 +07:00
ledgerwatch
aa18b70f6d
Not print commit cycle timing on newPayload cycle (#5711)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-10-12 09:51:23 +01:00
Alex Sharov
4795217e4e
e3: prevent files ranges overlap (#5684) 2022-10-12 10:18:55 +07:00
Andrew Ashikhmin
7286a0fef7
Create in-memory MDBX inside dirs.Tmp (#5702)
Previously "in-memory" MDBX instances for fork validation and mining
were created inside `os.TempDir()`. We should create them inside
Erigon's datadir so that the file permissions and the disk are the same
as for the main database.

Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/676.
2022-10-11 16:49:38 +01:00
ledgerwatch
a170d730c0
Fixing issues related to sync delays (#5689)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-10-11 08:04:40 +01:00
Alex Sharov
a2e51a2469
e3: prune limited amount before commit #675 (#5693) 2022-10-11 11:25:13 +07:00
Alex Sharov
6a7f8fb2a6
erigon3: cli command to force merge snapshots (#5680) 2022-10-10 09:47:01 +07:00
Alex Sharov
93e912b0ee
fix nil ptr in integration (#5656)
for https://github.com/ledgerwatch/erigon/issues/5651
2022-10-07 13:37:52 +07:00
hexoscott
c829c9f4f3
back to existing request bodies logic (#5650)
Moves bodies request logic to pre OOM changes. No logging or checking
for timeouts and moving forwards with every request made. Tested on a
local node that went through the DB migration on this branch and worked
fine, caught back up to the tip. Tested on POW initial sync and looked
to be working fine writing bodies, although didn't have time to see this
run all the way through the merge.
2022-10-06 20:27:06 +01:00
Giulio rebuffo
2fd96a0b1c
[Experimental] GRPC Prototype with --experimental.lightclient to have Erigon listen on ConsenSUS gossip. (#5590)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-10-06 11:01:56 +02:00
Alex Sharov
ca9aa4723c
Compress params change (#5631)
as of https://github.com/ledgerwatch/erigon-lib/pull/651
2022-10-05 17:54:54 +07:00
Alex Sharov
c48d51a582
snapshot index workers amount - based on available RAM and CPU (#5524) 2022-10-05 17:07:01 +07:00
ledgerwatch
94f4ea805d
Fixing hive SideChain reorg test (#5620)
the root cause is that when `inMemoryExecution` lambda gets created in
the `eth/backend.go`, it captures the reference of
`backend.notifications`, and so the execution of side-forks actually
adds notifications to there, and it all gets sent out to tx pool (and
RPC daemon) at the end of the stage loop (regardless of whether there
was forkchoice update or not)

so we can create a separate notification, but then somehow flush it to
the "main" nofitications when the in-memory exec state is flushed

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-10-05 05:42:38 +01:00
Andrew Ashikhmin
2217b2785e
SysCallContract shouldn't increase nonce of SystemAddress (#5617)
* Test GnosisGenesisStateRoot

* Delete obsolete allocations

* SysCallContract shouldn't increase nonce of SystemAddress

* Max gas limit in SysCallContract

* Restore error swallowing for Bor
2022-10-04 18:02:17 +02:00
ledgerwatch
fd52a788b7
Fix creation of block snapshots (#5579)
* Print snapshot prune

* More print

* Print

* Print

* Print

* Move snapshots stage forward

* Cleanup

* Fix tests

* Print

* Too much logging

* Remove print

* Log, check

* Revert

* No panic, print

* Fix tx numbering

* Harder condition to start retiring blocks

* Disable Pow verification after TTD is reached

* Fix POW verifying

* Print

* Prints

* Fix?

* cleanup

* Add migrations and hack

* More diagnostics

* More print

* Reset sequence only once

* Fix migration

* Remove print reset

* Fix lint

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-10-04 11:14:18 +01:00
Alex Sharov
15cac71f3f
madv helpers (#5610)
* save

* save

* save
2022-10-04 10:52:56 +01:00
hexoscott
b581bf30c0
Reintroduce oom fix (#5604)
* bring back oom fix for bodies with some new tweaks

* use in memory body cache when processing stages in memory
2022-10-04 10:44:23 +01:00
Alex Sharov
fa16d5e855
erigon3: step toward background snapshots build (#5588) 2022-10-02 10:21:17 +07:00
ledgerwatch
49aeb53988
Fail newPayload if execution is unsuccessful (#5553)
* Fail newPayload if execution is unsuccessful

* fix linter

* fix message

* no self-hosted

* try force ci

* back to unbuntu

* Remove unnecessary unwinds

* Fix canonicalising

* Quiet logs for in-memory exec

* Remove experimental overlay flag

* Fix sync test

* Fix test

* Fix lint

* Print hash in the end of the cycle

* Not notify headers if list is empty

* Supress timings and tables logs when no change in progress

* Reduce logging

* fix

* better log for pos download

* Better newPayload and forkChoice messages

* Fix lint

* simplify

* No duplication of download messages

* Reverse log for extension

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Igor Mandrigin <i@mandrigin.ru>
2022-09-29 06:38:13 +01:00
Alex Sharov
f4a7d2cf6d
erigon3: build .vi after download (#5568) 2022-09-29 12:14:51 +07:00
Alex Sharov
9cac57bcc9
erigon3: set seedable files to 32 steps #5534 2022-09-27 10:51:14 +07:00
ledgerwatch
c094a2b960
Revert "OOM fix for bodies stage (#5253)" (#5525)
This reverts commit 7fc7b91270.

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-09-26 15:27:38 +01:00
Alex Sharov
da7ca3cacf
erigon3: build .efi after download #654 (#5523) 2022-09-26 15:51:39 +07:00
Alex Sharov
cb60382e6d
erigon3: rename "history.v2" to "history.v3" to avoid naming miss-match with "erigon3" (#5519) 2022-09-26 10:54:42 +07:00
Alex Sharov
ef9e296efd
erigon method to test decompression speed (#5464) 2022-09-22 14:11:39 +07:00
hexoscott
7fc7b91270
OOM fix for bodies stage (#5253)
* OOM fix for bodies stage


change misleading bodies stage log messages


remove duplicate func to create key from block number


ensure body isn't nil when reading from bucket in bodies stage


remove unused blocknum variable from body requests


moving to using RLP encoding for stage bodies storage


encode bodies to RLP for stage bodies storage


better error handling in stage bodies


fixup body algos after rebase

* fixes for body stage oom after rebase
2022-09-22 12:27:42 +07:00
ledgerwatch
92c1b43259
Add test for CVE (#5450)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-09-21 12:27:46 +01:00
Alex Sharov
50811f9cd6
"erigon snapshots ram" command (#5449)
* save

* save

* save
2022-09-21 09:18:37 +07:00
hexoscott
705673c336
increased logging around POS mining (#5442) 2022-09-20 13:15:56 +01:00
Alex Sharov
54343d1d69
save (#5439) 2022-09-20 13:09:24 +01:00
Alex Sharov
db622cba4a
remove async snapshots interator (#5429) 2022-09-20 09:36:48 +07:00
Andrew Ashikhmin
05df5a4739
Revert "Docker pos fixup attempt1 (#5401)" (#5421)
This reverts commit 43c848ceb9.
2022-09-19 16:13:20 +02:00
Alex Sharov
c1bb4bc734
exec22: stagedsync test v1 (#5425)
* save

* save
2022-09-19 12:17:36 +07:00
Alex Sharov
9fb8a190bc
erigon22: folder snapshots/history (#5351) 2022-09-18 17:41:01 +07:00
Andrew Ashikhmin
222224ca86
Log peer ID (#5416) 2022-09-18 11:33:18 +02:00
ledgerwatch
43f592ed0e
Fixes for trace_block (#5402)
* Fixes for trace_block

* Print

* Print

* extra bodies

* extra bodies

* Add canonical check

* First fix for bodies mismatch

* More cleanup

* Advance progress

* Reset snapshots in integration

* Cleanup

* Way to reset snapshots stage

* Not reset sequence if not needed

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-09-17 12:53:27 +01:00
Giulio rebuffo
43c848ceb9
Docker pos fixup attempt1 (#5401)
* maybe fix

* maybe fix

* fix test sentry_mock

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
Co-authored-by: Igor Mandrigin <i@mandrigin.ru>
2022-09-17 11:49:13 +02:00
Temirlan
44266a9237
rcpdaemon, erigon: add --rpc.evmtimeout flag (#5395) 2022-09-17 13:25:27 +07:00
hexoscott
cd8cad6a89
allow multiple log subscriptions at the same time (#5358) 2022-09-16 14:36:25 +01:00
Andrew Ashikhmin
a8a104c35c
Merge & Downloader logging improvements (#5398)
* Prefix downloader logs with [Downloader]

* Better check for syncing

* Better handle nil dereference
2022-09-16 15:15:48 +02:00
Enrique Jose Avila Asapche
0c64c3f2c7
added a way to get latest executed block post POS (#5343)
* added a way to get latest executed block post POS

* added erigon_ExecutedBlockNumber into readme

* optional rpc.BlockNumber

* better message

* updated readme
2022-09-14 13:56:31 +03:00
Alex Sharov
4137c5df3d
don't append in in-memory execution (#5340) 2022-09-12 17:04:40 +07:00
Enrique Jose Avila Asapche
473ca51830
Adding back stage snapshots (#5331)
* added snapshots into stages list && deleted snapshots from defaul unwind

* added verkle trie

* using the same sentries client hd

* need to safe the stage progress of headers as well
2022-09-12 10:26:00 +07:00
Giulio rebuffo
99fbbb545b
Added complete verkle trie regeneration (#5310)
* verkle generation

* better UX

* q

* better verkle stuff

* for

* for o

* lint

* direct vtree

* addee verkle trees incremental promotion

* lint

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-09-10 20:00:03 +02:00
Leonard Chinonso
7495986515
Reverting Adding snapshots as a separate stage commit (#5329)
* reverting Adding snapshots as a separate stage commit

* more fixes to merge conflicts
2022-09-10 19:05:18 +02:00
Alex Sharov
d1ddb5ee82
erigon22: fix txn overlap (#5327)
* save

* save
2022-09-10 11:26:58 +07:00
Alex Sharov
f6ca07e215
integration --workers flag (#5326) 2022-09-10 10:37:56 +07:00
Enrique Jose Avila Asapche
6d1d3a9f47
moved retiring of blocks from senders into snapshot stage (#5290) 2022-09-09 21:48:16 +07:00
Alex Sharov
8813ea87fd
Erigon22: add state reconstitution to stage_exec (#5321) 2022-09-09 14:40:25 +07:00
Alex Sharov
caa23b9532
erigon22: simplify interhashes stage (#5315) 2022-09-08 14:02:50 +07:00
Andrew Ashikhmin
270fb4cde9
Fix IH when state contains addresses < 1st key in AccTrie (#5296)
* Test case that reproduces wrong trie root in Hive

* Do not hardcode roots

* Fix IH when state contains addresses smaller than the first key in AccTrie
2022-09-07 10:34:49 +02:00
hexoscott
ba6935ed03
fix for bodies stage looping infinitely when a block is mined locally (#5291) 2022-09-07 12:18:25 +07:00
Max Revitt
488121f669
fix(headers): signal cleanly shutdown headers and allow exit (#5286) 2022-09-06 08:02:24 +01:00
Alex Sharov
25e615a878
erigon22: historyReader22 and more tests (#5281)
* save

* save
2022-09-05 21:31:00 +07:00
Alex Sharov
6bfd2c3472
erigon22: rpc getLogs and traceFilter (#5277) 2022-09-05 11:33:55 +07:00
Alex Sharov
7874921e73
erigon22: correct incarnation (#5275) 2022-09-05 10:31:17 +07:00
ledgerwatch
da90c9752e
Fix for goerli resync (#5269)
* Fix for goerli resync

* Fix

* Fix lint

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-09-04 14:51:36 +01:00
Giulio rebuffo
435de928b7
Separation of Pedersen code, account and storage hashing (#5267)
* separation of pedersen hashing

* added multithreading to accounts

* more workers

* removed err

* ops

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-09-03 19:55:13 +02:00
Enrique Jose Avila Asapche
8fc7c78620
Bor txlookup (#5260)
* printing

* logging

* spam off

* ops

* clean up

* deleted all bor related stuff in snapshots

* adding bor tx to BorTxLookUp

* added readBorTxLookUp

* getting bor tx from bor lookup

* comments

* deleted bor related stuff

* deleting bor tx

* writing borTxLookUp in stage_txlookup

* using bytes

* little fixes

* updated erigon-lib

* using biEndian

* clean up

* setting bytes for big int

* log

* logging

* more logs

* delete logs
2022-09-02 17:41:58 +03:00
Giulio rebuffo
faebec48c9
Added pedersen hash generator utility in cmd/verkle (#5258)
* added tree key functions for verkle tries

* added tree key functions for verkle tries

* added tree key functions for verkle tries

* Pedersen hash generator

* removed extra functions

* better comment

* ops

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-09-02 15:45:30 +02:00
ledgerwatch
693017c554
Cleanup Tevm experimental code (#5259)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-09-01 19:49:29 +01:00
ledgerwatch
73e2d1146e
Cleanup interfaces (#5254)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-09-01 16:44:37 +01:00
Giulio rebuffo
361403f2ca
Added verkle tree key hash generating functions. (#5249)
* added tree key functions for verkle tries

* added tree key functions for verkle tries

* added tree key functions for verkle tries

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-09-01 02:15:40 +02:00
Enrique Jose Avila Asapche
8b3162a4c7
Small capacity (#5244)
* typo

* no log

* using headerBuf[1:]
2022-08-31 21:25:03 +07:00
Enrique Jose Avila Asapche
12331e018a
Fix bor txlookup (#5170) 2022-08-30 17:23:16 +03:00
Alex Sharov
c898c2a242
allow nil segment (#5224)
* Alpha modification

* save

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-08-30 11:01:26 +07:00
fynn.z
9c713d8168
Fixed mining system contract txn lost (#5212)
* fix mining exec error

* fix invalid memory

* remove logs

Co-authored-by: Jeff Rossiter <jeffrey.rossiter@me.com>
2022-08-30 09:47:47 +07:00
Alex Sharov
5e441bfa2a
erigon22: recent history read (#5209) 2022-08-28 11:26:01 +07:00
Alex Sharov
16fc9c7277
erigon22: HistoryReader22 #5203 2022-08-27 15:36:42 +07:00
Alex Sharov
a0af80014c
erigon22: rename historyReader22 to historyReader23 (#5202) 2022-08-27 15:21:02 +07:00
Andrew Ashikhmin
465c586ef4
Fix description of --prune=r flag (#5193)
* Fix description of --prune=r flag

* Small correction
2022-08-26 18:36:31 +07:00
Alex Sharov
d33096eaa7
erigon22: tests support (#5196) 2022-08-26 16:54:54 +07:00
Håvard Anda Estensen
beeccc0f5f
Remove capitalization and trailing newlines from err strings (#5186) 2022-08-26 13:20:19 +07:00
Håvard Anda Estensen
7c15ed59e4
Enable prealloc linter (#5177)
* Enable prealloc linter

* Set inital slice len to 0
2022-08-26 10:04:36 +07:00
Alex Sharov
69f3e1e99a
erigon22: step toward /tests 2022-08-25 15:32:05 +07:00
Alex Sharov
fb2294d124
Erigon22: basic txNum forward/unwind (#5176) 2022-08-25 12:24:01 +07:00
Andrew Ashikhmin
1ce144a988
Revert recent change to MiningStep (#5168) 2022-08-24 12:47:11 +02:00
Andrew Ashikhmin
b3d99f8e8c
Small cleanups (#5162) 2022-08-24 11:35:39 +02:00
Alex Sharov
16d02c8cc9
erigon22: unwind trie support (#5159) 2022-08-24 11:37:58 +07:00
Alex Sharov
69fbfc9bef
Snapshots: Erigon update list in db only after Downloader confirmation, rpcdaemon read list from db (#5150) 2022-08-23 16:28:07 +07:00
Alex Sharov
c1214e4ac5
erigon22: incremental stage trie (#5116) 2022-08-19 13:23:23 +07:00
Alex Sharov
30324fbb81
erigon22: get acc index from aggregator22 (#5114) 2022-08-19 11:30:59 +07:00
Alex Sharov
cb9f86fcbc
erigon22: incremental hash state stage (#5111) 2022-08-19 10:00:47 +07:00
Alex Sharov
46ef7e5305
erigon22: incremental hash state stage (#5102) 2022-08-19 09:35:43 +07:00
fynn.z
82fb73a545
Fix in-flight sealing task not abort when next sealing task coming (#5103)
* Fix in-flight sealing task not abort when next sealing task coming, may cause lightclient state verify failed.

* fix integretion err
2022-08-18 18:35:30 +07:00
Alex Sharov
db95b9a194
RPCDaemon: improve UX - when erigon not available - still can use snpashots (#5073) 2022-08-16 15:45:27 +07:00
Alex Sharov
a9801d36db
fix nil pointer at startup when not all indices available yet #5070 2022-08-16 08:44:41 +07:00
Enrique Jose Avila Asapche
f0c7235f97
Pruning Receipts Default (#5065) 2022-08-15 17:21:18 +03:00
dmitriyselivanov
4499e04a05
rpcdaemon: wire the most recent of EthBackend.builders.block as a pending block into eth_getBlockByNumber (#5061) 2022-08-15 15:19:45 +07:00
Alex Sharov
1a1b606146
erigon22: unwind code (#5058) 2022-08-15 10:27:32 +07:00
Alex Sharov
6495ec6d28
erigon22: working PlainState unwind (#5051) 2022-08-14 18:06:32 +07:00
Giulio rebuffo
c58a3be765
ops (#5048)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-13 23:40:53 +02:00
Giulio rebuffo
6713abb420
fixed exec22 panic (#5045)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-13 18:54:32 +01:00
Alex Sharov
52fd0d0e8b
Aggregator22.Unwind() (#5039)
* save

* save
2022-08-13 18:51:25 +07:00
Alex Sharov
e27f669a3f
erigon2.2: save stage progress to chainDB, can run "integration stage_exec" and "state erigon22" on same datadir (#5033) 2022-08-13 11:17:24 +07:00
Giulio rebuffo
8ade569cc5
Save PoW blocks for processing received through P2P (#5015)
* save terminal blocks

* ops

* save less PoW blocks

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-12 21:54:20 +02:00
fynn.z
6a4cd468c7
fix stage sync hang at a mined block (#5018) 2022-08-12 17:01:50 +07:00
Alex Sharov
4594ce5ef7
erigon22: history.v2 flag, align rpcdaemon22 (#5016)
* save

* save

* save

* save

* save
2022-08-12 16:13:14 +07:00
Giulio rebuffo
348be13508
fixed gossip post TTD (#5012)
* gossip all gossip

* gossip all gossip

* fixed tests

* fixed gossip post TTD

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-11 19:55:59 +02:00
Alex Sharov
a7d07ad04d
erigon22 add to exec stage (#5008)
* save

* save

* save
2022-08-11 21:06:41 +07:00
Alex Sharov
e786cbac24
E22 step2 (#5002) 2022-08-11 11:19:59 +07:00
Alex Sharov
f83032533f
Revert "move exec22 to package, call it from stage_exec (#5000)" (#5001)
This reverts commit efa6dfd8ce.
2022-08-11 11:18:23 +07:00
Alex Sharov
efa6dfd8ce
move exec22 to package, call it from stage_exec (#5000) 2022-08-11 11:17:03 +07:00
Giulio rebuffo
b09de9e0d5
[P2P] gossip all gossip (#4995)
* gossip all gossip

* gossip all gossip

* fixed tests

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-10 22:08:56 +02:00
Giulio rebuffo
0863048d6d
added P2P gossip for newBlock66 (#4987)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-10 14:56:06 +02:00
Alex Sharov
351cd49c21
go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
hexoscott
a573f8356f
rpc: concurrent map issue with log subscription fix (#4971)
* rpc: concurrent map issue with log subscription fix

* rpc: subscription changes around locking
2022-08-10 16:01:53 +07:00
cgst
f560f3788f
HeaderByHash segment loop should break on result (#4969) 2022-08-09 15:03:39 +07:00
Alex Sharov
9595c239c2
erigon22: optimize index.add #571 (#4965)
* save

* bsc
2022-08-09 10:28:36 +07:00
Giulio rebuffo
6d86b3a403
use of memory batch (#4961)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-08 18:20:12 +02:00
Enrique Jose Avila Asapche
c12d298f1c
new rpc block number (#4953)
* new rpc block number

* log

* ops
2022-08-08 19:07:24 +07:00
Giulio rebuffo
7a64fe44eb
UX improvement for pre-merge sync with Teku (#4955)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-08 11:26:34 +02:00
Giulio rebuffo
a481b77489
removed incarnation updates and removed side forks past fcu (#4944)
* removed incarnation updates and removed side forks past fcu

* has

* fixed hive

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-08-05 18:07:27 +02:00
Alex Sharov
05e5634653
snap indexing: fix logging #4937 2022-08-05 09:01:17 +07:00
Leonard Chinonso
43f5ab09f8
Fixed lint errors for gosec linter (#4933)
* Fixed lint errors for gosec linter

* Changed uint64 to int64 in common/GetRandInt

* Changed naming of function
2022-08-04 14:59:40 +01:00
Leonard Chinonso
592fe32217
Refactoring To Increase Code Quality (#4842)
* General cleanup and fixes

* Cleaning part 2

* cleanup part 3

* Refactored staterunner to have a handler function

* Fixed linting

* Cleanup part 4

* Changed the initialization of the require package and updated .golangci.yml

* Fixed lint errors from golangci-lint

* deleted state_recon_1.go

* fixed build error

* Added ReadHeaderTimeouts for httpServer

* made changes to golangci

* Reset golangci.yml
2022-08-04 20:23:00 +07:00
Enrique Jose Avila Asapche
a0da31bb1d
Transaction count fix (#4888)
* getBlockTransactionCountByHash using snapshots

* got body from block reader

* requesting block body with transactions

* tests

* added tx amount into blocreader body

* using txAmount from body
2022-08-04 18:49:53 +07:00
Andrew Ashikhmin
5ea692f2de
Remove authrpc.* flags from rpcdaemon (#4931)
* README: Move port 8551 from RPC to erigon ports

* Some renaming for consistency

* Remove authrpc.* flags from rpcdaemon

* docker-compose: move --authrpc.jwtsecret to erigon

* minor typo
2022-08-04 12:51:01 +02:00
Andrew Ashikhmin
4fb27b60f9
Clean up BodyDownload.VerifyUncles (#4928) 2022-08-04 11:47:01 +02:00
Alex Sharov
1413b1c37c
Sn: parallel files indexing progress logs (#4925) 2022-08-04 12:31:25 +07:00
Alex Sharov
eb07869065
fix --snap.keepblocks flag use (#4924) 2022-08-04 10:03:39 +07:00
Alex Sharov
c3777f2820
Sn better log indexing2 (#4923)
* auto-build-idx

* save

* save
2022-08-04 09:55:06 +07:00
Alex Sharov
b1db36eb09
snap: better log indexing (#4921) 2022-08-04 09:39:29 +07:00
hexoscott
98c639784b
rpc: fix for map concurrency issue in logs subscription (#4903)
moving a couple of mutex locks and introducing another to prevent a deferred call to unsubscribe clashing with a new call to subscribe
2022-08-03 00:37:34 +07:00
Leonard Chinonso
ec67e80a8a
Fixed lint errors for gocritic linter (#4904) 2022-08-03 00:35:22 +07:00
Andrew Ashikhmin
7199dcf7a2
Rename engine.* flags to authrpc.* for consistency with geth (#4890)
* Update README re. Engine API

* Remove obsolete code

* Don't apply --rpc.accessList to Engine API listener

* Simplify startAuthenticatedRpcServer

* Rename engine.* cmd flags to authrpc.* for consistency with geth

* More renamings

* Introduce --authrpc.vhosts flag
2022-08-02 13:15:01 +07:00
Alex Sharov
053fc18b44
remove debug line (#4895) 2022-08-02 10:50:40 +07:00
Alex Sharov
e60b38e283
decompress: catch maxDepth underflow (#4882)
* save

* save
2022-08-01 12:40:00 +07:00
Alex Sharov
a50d4c2852
snap indexing: less logs (#4877) 2022-08-01 11:07:07 +07:00
Alex Sharov
bd4bed5933
fix 64kb pageSize page_full corner case (#4847) 2022-08-01 11:03:28 +07:00
Giulio rebuffo
3a972cc074
Removed the use of memory mutation for side-fork unwinds. (#4857)
* done

* updated sum and mod

* error handling

* error handling

* comments

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-31 15:56:08 +02:00
Enrique Jose Avila Asapche
66c033a241
Adding config-file flag (#4868)
* added flag

* working flag ovewrite for http

* setting up all flags with yaml file

* comment

* ops

* set flags in the cli trump yaml config file

* changed to config.yaml.file

* ops

* better naming

* accepting toml or yaml files

* fixed flag

* fixed messages
2022-07-31 10:46:00 +07:00
Alex Sharov
aee4b53788
save list of snapshots in db (#4777)
* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2022-07-28 16:57:38 +07:00
Andrew Ashikhmin
d85e3c626e
Fix consensus tests (#4844)
* Fix timeout in (*MockSentry) insertPoSBlocks

* Fix bcInvalidHeaderTest/DifficultyIsZero
2022-07-27 17:43:48 +02:00
Andrew Ashikhmin
1ffa984457
Don't wait for CL in initialCycle (#4841) 2022-07-27 13:52:50 +02:00
Giulio rebuffo
101e181c52
if PoS download block is within reach, determine VALID or INVALID (#4812)
* if PoS download is fast enough, determine VALID or INVALID

* more acceptable absolute value

* solved comments

* remove useless

* moved check in stage_headers

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-26 15:24:02 +02:00
Andrew Ashikhmin
c1f848746d
Update consensus tests to v11 (#4724)
* Consensus tests update 11

* Add GrayGlacier fork

* Wire currentRandom from tests into PREVRANDAO

* Serenity engine

* Support insertion of PoS blocks in MockSentry

* Introduce marshallTypedTransactionsAsRlpStrings arg into (*Block) RawBody()

* Revert "Introduce marshallTypedTransactionsAsRlpStrings arg into (*Block) RawBody()"

This reverts commit 903fca572be03c7de33318ce177a03a4be34927b.

* Post-merge fix

* Don't wait for Beacon Chain in tests

* Skip powToPosBlockRejection transition test

* ForkChoice in insertPoSBlocks

* Add withPosDownloader arg to MockWithEverything in order to fix TestPoSDownloader
2022-07-26 09:35:38 +02:00
Alex Sharov
60f1adddcd
implement server kv.Snapsthos() method (#4831)
* save

* save
2022-07-26 10:44:47 +07:00
Giulio rebuffo
1cb6be02a5
Avoid constantly triggering stageloop when using Engine API (#4797)
* avoid constantly triggering stageloop when using Engine API

* fix lint + test

* fixed comments

* ops

* little fixes here and there

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-23 18:57:23 +02:00
Alex Sharov
68e35417fc
RetireBlocks: encapsulate delete logic 2022-07-23 11:09:16 +07:00
Alex Sharov
cd8b10f57e
snapshot merger: smaller interface (#4786)
* save

* save

* save
2022-07-22 16:54:05 +07:00
Giulio rebuffo
46a8c531ce
Optimized PoS header downloader (#4775)
* optimized PoS header downloader

* removed println

* comments

* ops

* Restore schedulePoSDownload params + simplify

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-07-22 11:07:58 +02:00
Artem Tsebrovskiy
a1777accd8
fixed passing of raw byte slices to tx processing (#4782) 2022-07-22 15:47:33 +07:00
Alex Sharov
66758c7960
RetireBlocks: less arguments (#4785)
* save

* save
2022-07-22 13:44:42 +07:00
Andrew Ashikhmin
6060b87840
Fix binary vs raw confusion for PoS transaction (#4781)
* Replace PayloadMessage with Block

* RawTransactions -> BinaryTransactions for clarity

* add a log warning
2022-07-21 19:40:00 +02:00
Giulio rebuffo
1becfc509b
extra reset before starting change in rewind side fork (#4774)
* extra reset before starting change

* extra reset before starting change

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-21 04:06:26 +02:00
Giulio rebuffo
7573a41069
fixed accumulator nil case (#4773)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-21 03:47:37 +02:00
Giulio rebuffo
73b028a5fd better payload cleanup (#4772)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-20 18:16:42 +02:00
Alex Sharov
1ecacde3a9
trackerslist: convert from git submodule to go package (#4761) 2022-07-20 09:47:58 +07:00
Alex Sharov
5805d963ea
erigon-snapshot: convert from git sumbodule to golang package (#4760) 2022-07-20 09:34:12 +07:00
Giulio rebuffo
d4f865d725
Added proper cleanup when we get notified of new height (#4753)
* added proper cleanup when we get notified of new height

* added extra cleanup

* removed bad if condition

* fixed hive tests

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-19 22:31:15 +02:00
Enrique Jose Avila Asapche
e768227d38
Merge range (#4749)
* added merge range into segments

* got rid of missing snapshot errors

* reusing RequestSnapshotDownload

* sleep out of download

* ops

* warning if we are missing snapshots
2022-07-19 19:27:54 +07:00
Alex Sharov
d3b424c9f6
Mdbx: GC BigFoot (#4750) 2022-07-19 16:53:18 +07:00
Andrew Ashikhmin
ab28089583
Still fixing index out of range in (*Accumulator) ChangeStorage (#4751) 2022-07-19 11:11:08 +02:00
Andrew Ashikhmin
5862899979
Fix index out of range in (*Accumulator) ChangeStorage (#4738) 2022-07-18 19:03:38 +02:00
Enrique Jose Avila Asapche
8dceb6fe82
Auto download snapshots (#4729)
* refactored request download

* keeping track of missing snapshots

* using slice mergeRange

* request snapshots on reopen

* passing arguments

* passed in var

* Revert "passed in var"

This reverts commit 90478978dfa9f2a6dd5b1b051fc1d3f9e5f7a9c5.

* Revert "passing arguments"

This reverts commit 1e39c4152003796f6ff0bcfc188512d4a43bd18d.

* Revert "request snapshots on reopen"

This reverts commit d40212b973bc15db2b25cc1b0abb22051a3debb1.

* added downloadRequest
;

* downloading missing headers at start up

* there shouldnt be an error anymore

* not using nil;
;
2022-07-18 17:42:20 +03:00
Alex Sharov
15ca3d25c1
snapshots: mainnet to 15m #4733 2022-07-18 15:36:53 +07:00
Giulio rebuffo
fb9f193349
fixed Two Block PoW Re-org to Higher-Height Chain (#4730)
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-07-18 03:04:02 +02:00
Giulio rebuffo
8a754cd252
Added PoS download validation when applicable (#4728)
* added incomplete version of PoS download validation

* fixed stuff
2022-07-17 02:02:53 +02:00
Andrew Ashikhmin
af661a9459
Fix canExtendCanonical when some headers are downloaded (#4709)
* Fix canExtendCanonical when some headers are downloaded

* Restore original logic for forkValidator.ValidatePayload

* Check FCU status
2022-07-14 11:03:15 +02:00
Andrew Ashikhmin
dd1a5944a9
Better logging for invalid PoS headers (#4703) 2022-07-13 12:07:21 +02:00
Giulio rebuffo
6b6b74e034
removed code duplication (#4697) 2022-07-12 15:25:32 +02:00
Giulio rebuffo
b161c27ac3
optimized one db read (#4694) 2022-07-12 10:39:57 +02:00
Giulio rebuffo
51245d294f
Add PoS validator struct [Refactoring] (#4690)
* added fork_validor struct

* replaced occurences of hd with forkValidator

* added engineapi.validatorFork

* 32 blocks maxForkDepth

* removed useless if
2022-07-11 15:12:21 +02:00
Levi Aul
8de866028a
Additional bor RPC fixes (#4675)
* Add borTx to GetBlockByHash; ensure borTxs have hashes; don't try to derive sender for borTxs

* Surface borReceipt logs in eth_getLogs

* Check for existence of borReceipt before synthesizing a borTx
2022-07-09 09:15:22 +06:00
Andrew Ashikhmin
225935b376
Bump log level of some PoS messages from Trace to Debug (#4682) 2022-07-08 15:18:36 +02:00
Andrew Ashikhmin
eec5fa4d41
Add support for eth/67 (#4564)
* Add eth/67

* Listen to eth/66 on a separate port

* Fix compilation error

* Fix cfg66.ListenAddr

* Update erigon ports in README

* Expose port 30304 in docker

* P2pProtocolVersionFlag instead of second sentry

* Remove "66 by default" from usage

* Small comment
2022-07-08 11:14:16 +02:00
sudeep
e13a318e0b
evm t8n to use ExecuteBlockEphemerally api (#4642)
* evm t8n tool to use ExecuteBlockEphemerally api (#4512)

* fix to set V, R, S in legacy transaction

* fix to dump post-execution alloc for evm t8n

* close tx in evm t8n

* populate current difficulty and gas used in output result

- update the ExecutionResult to include corresponding info (like
  Difficulty/GasUsed)

* initial attempt at migrating 'evm t8n' to use ExecuteBlockEphemerally

* using ExecutionResult in ExecuteBlockEphemerally

* bypass validations and integrate with EphemeralExecResult

* fixing output of 'evm t8n'

- remaining bits are "stateRoot" in results.txt and "balance" field for one account in
  alloc.txt (for testdata=1)

* get ExecuteBlockEphemerally to accept getTracer lambda

* fix build failure

* test cases for evm t8n

* more test cases for evm t8n

* fix stateRoot computation in evm t8n

* remove reward argument, as EBE itself takes care of it

* final cleanups for migration to using ExecuteBlockEphemerally

* change EBEforBSC to match EBE

* fix linter issues

* manually revert an unwanted diff

* avoid calculating ReceiptHash twice

* linter check

* minor correction

* remove unnecessary logic in EBEforBsc

* fix integration tests

* fix build
2022-07-07 12:47:00 +01:00
Levi Aul
7b80744768
Ensure (fake) Bor txs + receipts are returned from all relevant RPC methods (#4663)
* Ensure fake Bor txs + receipts are returned from all relevant RPC methods

* Add rest of bor implementation for eth_getBlockByNumber

* Use TxLookup index to find Bor txs

* Fix txHash on emitted borTxs and borReceipts

* Fix checks given that borTxs get registered in TxLookup; remove useless ref indirections
2022-07-07 14:40:50 +06:00
Alex Sharov
01bca8f1e2
TxPool: generics btree (#4665)
* save

* save

* save

* save
2022-07-07 11:07:48 +06:00
ledgerwatch
329d586464
Try to reproduce and fix eth_getBlockByNumber returning nil (#4608)
* Small optimisation for eth_getBlockByNumber

* Option to not retrieve transactions

* fixes

* Check hash

* Fixes

* Avoid shadowing of err in BlockWithSenders

* Fix test

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-07-06 14:10:12 +01:00
Giulio rebuffo
99208ff4dc
Fixed hive test (#4653) 2022-07-06 13:52:49 +02:00
Alex Sharov
d9cb87a149
RPC: Enable back json streaming for non-batch and non-websocket cases (#4647)
* enable rpc streaming

* enable rpc streaming
2022-07-06 11:44:06 +01:00
Giulio rebuffo
5e1cc9ae51
fixed Invalid Number reorg (#4643) 2022-07-05 23:40:10 +02:00
Giulio rebuffo
d4a0aff53f
fixed hive test: Transaction Reorg - Check Blockhash with NP on revert (erigon) (#4640) 2022-07-05 20:03:05 +02:00
Alex Sharov
7e2d46cbe4
Support "latests block number" in Oracle Backend (#4635)
* save

* save

* save

* save

* save

* save

* save

* save
2022-07-05 14:49:39 +06:00
Giulio rebuffo
a76e6a1d05
fixed deadlock (#4633) 2022-07-05 09:53:28 +02:00
Giulio rebuffo
d83b7a4ae0
Proper PoS Error reporting (#4631)
* better reporting

* removed debug log

* proper error reporting
2022-07-05 01:31:16 +02:00
Temirlan
782b8b6557
rpcdaemon, erigon: add new flags (#4623)
Co-authored-by: Темирлан Ермагамбет <etmr@technodom.kz>
2022-07-04 13:07:45 +02:00
Andrew Ashikhmin
00ee68e4a1
FeedHeaderPoS already writes header number (#4626)
* FeedHeaderPoS already calls WriteHeaderNumber

* Moreover, WriteHeader already writes to HeaderNumber
2022-07-04 11:28:10 +02:00
Giulio rebuffo
b980280785
Fixed hive test on invalid transition payload (#4618)
* experiment #1

* experiment #2

* experiment #3

* experiment 4
2022-07-03 17:36:39 +02:00
Giulio rebuffo
3fc51f5ef7
Revert "Proper Pos block checker when INVALID/ACCEPTED status is sent (#4604)" (#4616)
This reverts commit e90e03ae31.
2022-07-03 13:11:16 +02:00
Giulio rebuffo
fd2886b927
Revert "fixed compilation (#4614)" (#4615)
This reverts commit 1c5ec22d09.
2022-07-03 12:54:27 +02:00
Giulio rebuffo
1c5ec22d09
fixed compilation (#4614) 2022-07-03 12:37:31 +02:00
Giulio rebuffo
e90e03ae31
Proper Pos block checker when INVALID/ACCEPTED status is sent (#4604)
* added proper PoS block checker

* proper invalid lvh

* p

* fixed smol thingy

* fix more

* fixed engine API

* fixed engine API

* better nil hash

* added 0x0 checks

* full support
2022-07-03 11:58:57 +02:00
ledgerwatch
77dc35bb85
Revert "evm t8n tool to use ExecuteBlockEphemerally api (#4512)" (#4610)
* Revert "evm t8n tool to use ExecuteBlockEphemerally api (#4512)"

This reverts commit db93d2ea37.

* Fix compilation

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-07-02 23:24:20 +01:00
Giulio rebuffo
3de3baf585
default side fork support (#4611) 2022-07-03 00:14:22 +02:00
ledgerwatch
8599dceec7
[erigon2.2] State reconstitution prototype (#4508)
* reconstitution

* Add history access without state function

* More on state reconstitution

* More on state recon

* More on state recon

* More

* More

* support dao fork

* More on state reconstitution

* Update to erigon-lib

* More

* Added genesis block and filling with history

* update

* Genesis works

* Start on parallel

* Preparation for parallel reconstitution, stats for EfSearch

* continue with parallel work

* Fix history reader

* Remove time measurements

* Fixes

* Fixes and UX improvements

* Fixes

* More tracing

* More fixes

* More fixes

* Fix code size

* Update to latest erigon-lib

* Fix for dao fork

* Remove hacks

* Update to erigon-lib, fix lint

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-07-02 20:48:42 +01:00
sudeep
db93d2ea37
evm t8n tool to use ExecuteBlockEphemerally api (#4512)
* fix to set V, R, S in legacy transaction

* fix to dump post-execution alloc for evm t8n

* close tx in evm t8n

* populate current difficulty and gas used in output result

- update the ExecutionResult to include corresponding info (like
  Difficulty/GasUsed)

* initial attempt at migrating 'evm t8n' to use ExecuteBlockEphemerally

* using ExecutionResult in ExecuteBlockEphemerally

* bypass validations and integrate with EphemeralExecResult

* fixing output of 'evm t8n'

- remaining bits are "stateRoot" in results.txt and "balance" field for one account in
  alloc.txt (for testdata=1)

* get ExecuteBlockEphemerally to accept getTracer lambda

* fix build failure

* test cases for evm t8n

* more test cases for evm t8n

* fix stateRoot computation in evm t8n

* remove reward argument, as EBE itself takes care of it

* final cleanups for migration to using ExecuteBlockEphemerally

* change EBEforBSC to match EBE

* fix linter issues

* manually revert an unwanted diff

* avoid calculating ReceiptHash twice

* linter check

* minor correction

* remove unnecessary logic in EBEforBsc
2022-07-02 06:52:23 +01:00
primal_concrete_sledge
fff6e4ffa5
fix/issue-4593_fix_closed_chan (#4603) 2022-07-01 20:59:52 +01:00
Alex Sharov
2415fecb26
--downloader.verfiy flag to verify once on startup (#4597)
* save

* save

* save

* save

* save

* save
2022-07-01 16:52:43 +06:00
Giulio rebuffo
33892ffd79
Fixed transaction on hive tests (#4590)
* try 1

* try 1

* fix now?

* Update accessors_chain.go

* Update accessors_chain.go

* added comments
2022-07-01 11:02:24 +02:00
Alex Sharov
c03d57356c
prevent downloading new snapshots after initial sync (#4585) 2022-06-30 22:35:44 +06:00
Giulio rebuffo
087105d1f3
lvh on invalid transition block (#4583) 2022-06-30 18:20:21 +02:00
Andrew Ashikhmin
7cd195117f
More robust quitting of PoW mining (#4574)
* isTrans -> cfg.blockBuilderParameters != nil

* More robust quitting of PoW mining
2022-06-29 17:39:12 +02:00
Alex Sharov
6add6ecd0e
Snapshots: new bsc hash #4578 2022-06-29 20:42:05 +06:00
Andrew Ashikhmin
8f86c5d615
Remove getNodeData experimental feature (#4559) 2022-06-29 18:23:00 +06:00
Giulio rebuffo
ed69bac065
Fixed in-memory execution hive tests (#4565)
* badBlockHalt

* fixed buidl

* lintl
2022-06-29 08:28:00 +06:00
Giulio rebuffo
aa7985341e
LVH support to memory overlay (#4555)
* fixed fcu

* fixed leak

* maybe now?

* wrote forkchoice
2022-06-28 17:46:24 +02:00
Andrew Ashikhmin
dc5d3ffaac
Revert "Switch from eth/66 to eth/67 (#4549)" (#4562)
This reverts commit 16e57aa8a2.
2022-06-28 13:42:35 +02:00
Andrew Ashikhmin
16e57aa8a2
Switch from eth/66 to eth/67 (#4549)
* Switch from eth/66 to eth/67

* Fix a compilation error

* Update erigon-lib

* Refresh erigon-lib
2022-06-28 10:12:48 +02:00
Alex Sharov
538b4fea6c
Snapshots: don't panic after too far reset (#4558)
* save

* save

* save

* save
2022-06-28 10:31:44 +06:00
Giulio rebuffo
588c2d4e36
Implemented side forks support (up to depth of 128). (#4514)
* side forks

* fixed stuff

* lint

* update go.mod and go.sum

* cmd

* added comment

* better validatePayload

* fixed empty payload sometimes

* support future side forks

* added crit error handle

* fix compile err

* lint
2022-06-27 15:59:54 +02:00
Alex Sharov
b9cb6d953e
Fix nil td (#4546)
* save

* save
2022-06-26 17:27:14 +06:00
Alex Sharov
afd07e5dee
--no-downloader flag support (#4545) 2022-06-26 17:13:32 +06:00
Alex Sharov
529682aa9d
New goerli snapshot (#4544) 2022-06-26 17:13:07 +06:00
primal_concrete_sledge
5e2f6bb2db
Fix/new eth filters (#4504)
* Add fixes to eth_newPendingTxFilter and others

* Fix tests

* Add test

* Add goroutines return on closed chans
2022-06-24 09:11:38 +01:00
Andrew Ashikhmin
8de7c5e41c
JSON parsing of safe & finalized (#4524) 2022-06-23 19:37:39 +02:00
Giulio rebuffo
7896fc60b6
fixed notifications (#4520) 2022-06-23 17:23:35 +02:00
Andrew Ashikhmin
0a527feddb
Send Engine API response after tx.Commit() even when useExternalTx (#4516)
* pendingPayloadStatus -> pendingPayloadHash

* Ensure that Engine API response is sent after tx.Commit() even when useExternalTx

* ProcessEngineApiResponse -> SendEngineApiResponse

* PayloadResponse -> PayloadStatus
2022-06-22 14:54:23 +02:00
Andrew Ashikhmin
18e5bf3bbf
Rework PR 4505 (#4511)
* Revert "Update chainConfig in the database (#4505)"

This reverts commit f38ab485e0.

* Only preserve config of unknown chains
2022-06-21 10:17:54 +02:00
Andrew Ashikhmin
daa84922d6
Commit transaction before responding on Engine API (#4506)
* Remove an unused interrupt value

* Remove sendErrResponse from safeAndFinalizedBlocksAreCanonical

* Clean up err handling

* startHandlingForkChoice returns response

* handleNewPayload returns response

* Commit transaction before responding on Engine API

* small fix

* Reply with SYNCING before long unwind

* schedulePoSDownload doesn't require requestStatus anymore
2022-06-20 23:03:17 +02:00
ledgerwatch
f38ab485e0
Update chainConfig in the database (#4505)
* Update genesis.go

* Remove the test

* Remove unnecessary code

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-20 16:51:19 +01:00
Giulio rebuffo
7a2b575e56
Added memory execution (#4446)
* add

* added in memory execution draft

* func to state

* added functionality

* backend function for memory execution

* simplified stage state

* haltable stage execution

* added mod sum

* hd

* sl

* LOL

* LOL again

* need trace

* more logs

* added cleanup on fcu

* fcu

* mod

* bunch of prtln

* feed

* ops

* headers notify

* revert

* slightly more commented

* head

* nil block retire

* comments

* prevent clean

* corrected occasional panics

* fixed lint
2022-06-19 20:45:36 +01:00
ledgerwatch
64067a2b77
Debugging Engine API (#4488)
* defer tx rollback

* Add http.trace flag

* Fixed http.trace flag

* Fix lint

* Fix lint

* Delete unused tests

* Fix lint

* Fix lint

* Fix lint

* Fix lint

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-19 13:40:28 +01:00
ledgerwatch
93151f0ae6
[erigon2.2] Reduce allocations when replaying historical txs (#4460)
* [erigon2.2] Reduce allocations when replaying historical txs

* import new API, fix code

* Add hack decompress function

* update erigon-lib

* Fix hack

* Update to latest erigon-lib

* Fix reindexing

* Enable skip analysis for tracing calls too

* Enable for eth_getLogs

* Fix skip analysis

* Optimise

* Stop grpc server in the tests

* Print

* No panic on server stop

* Update to latest erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-17 13:40:49 +01:00
ledgerwatch
b1572a15d5
No reorgs when fork choice head points to a canonical header (#4466)
* No reorgs when fork choice head points to a canonical header

* Return immediately

* Fix sentry

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-16 16:07:09 +01:00
Giulio rebuffo
2e600316e3
Used memory batches from Erigon (#4469)
* modded summed

* deleted

* ops
2022-06-16 16:39:56 +02:00
ledgerwatch
21e3ebdab5
Update skip analysis, add more BSC snapshot hashes (#4448)
* Update skip analysis, add more BSC snapshot hashes

* Syntax fix

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-14 16:06:42 +01:00
Enrique Jose Avila Asapche
a5cb53d690
safe and finalized blocks from eth_getBlockByNumber (#4436)
* added getFinalzed and getSafe block num

* added rpc finalized and safe block num

* getting nums

* returning nil

* returning nil

* added to helper.go

* removed repeated code

* added functions into rpchelper

* returning err

* simplified

* using previous latest getter

* getting pending block with filter/

* Fix plain state block number

* Fix test

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-14 11:07:46 +03:00
Giulio rebuffo
1f36d76e09
Added Flush function to memory mutation (#4439) 2022-06-13 18:20:18 +02:00
Andrew Ashikhmin
eb497372ae
Interruptible PoS block building (#4438)
* Fix a typo

* BlockBuilder dummy

* BlockProposerParametersPOS -> BlockBuilderParameters

* Pass tx to MiningStep

* BlockBuilderFunc

* Interrupt in MiningExec Stage

* Draft implementation of BlockBuilder

* Fail back to empty header

* Add a comment

* cosmetic change

* Cosmetic change again

* It's not safe to pass transactions between goroutines
2022-06-13 15:43:09 +02:00
ledgerwatch
fd8adddce8
trace_filter implementation based on erigon 2 update 2 data (#4431)
* trace_filter implementation based on erigon 2 update 2 data

* Fix test compile, extract txNums

* Update to erigon-lib, add generic heap

* Fix getHeaderHash for RPC methods

* Missing files

* Skip tests

* Add reward traces

* Filter trace lint

* Reinstate filtering

* Print

* Print

* Fix

* Print

* Print txNums

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Remove prints

* Fix nil dereference

* Inclusive toBlock bound

* Print

* Print

* Hack

* remove some deps

* Fix lint

* Update erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-12 12:44:01 +01:00
ledgerwatch
8e3ac8a21c
Erigon2 upgrade 2 prototype (#4341)
* Erigon2 upgrade 2 prototype

* Latest erigon-lib

* Fixes

* Fix print

* Fix maxSpan

* Reduce maxSpan

* Remove duplicate joins

* TxNum

* Fix resuming

* first draft of history22

* Introduce historical reads

* Update to erigon-lib

* Update erigon-lib

* Update erigon-lib

* Fixes and tracing for checkChangeSets

* More trace

* Print account details

* fix getHeader

* Update to erigon-lib main

* Add tracer indices and event log indices

* Fix calltracer

* Fix calltracer

* Duplicate rpcdaemon into rpcdaemon22

* Fix tests

* Fix tests

* Fix tests

* Update to latest erigon-lib

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-10 16:18:43 +01:00
Krishna Upadhyaya
1e3c90ba80
Bor devnet option (#4428)
* bor mining testing

* Implemented bor-devent network

* Minor fixes

* use signer as validator

* remove unused spaces

* fix typo
2022-06-10 15:32:04 +07:00
Giulio rebuffo
f9024fed84
Removed annoying log (#4424) 2022-06-10 01:54:22 +02:00
ledgerwatch
f31abfe83b
Fixes for RPC notification log (#4410)
* Underflow fix

* Fix rpc notification to 0

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-09 08:48:19 +07:00
Andrew Ashikhmin
644d25d25d
MergeForkBlock -> MergeNetsplitBlock (#4407) 2022-06-08 12:41:50 +02:00
ledgerwatch
2305d09d0d
Print blocks to TTD (#4405)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-08 10:26:42 +01:00
Alex Sharov
c97064173e
Open reset blocks migration: to delete .torrent files also #4404 (#4404) 2022-06-08 09:51:07 +07:00
Alex Sharov
d7d698f565
db migration to reset blocks (#4389)
* save

* save

* save

* save

* save

* save

* Update reset_blocks.go

* Not to remove too many tx lookup files

* Fix truncate blocks and add reset txlookup

* Fix bodies

* Fix nil pointer

Co-authored-by: ledgerwatch <akhounov@gmail.com>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-06-07 19:59:14 +01:00
ledgerwatch
e90bc39e04
Another anchor fix (#4395)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-07 09:42:58 +01:00
Alex Sharov
d655854b53
Snapshots: optimisticaly open at app startup (#4393)
* save

* save
2022-06-07 12:33:33 +07:00
Alex Sharov
e146b66e35
more usage of dirs object #4390 2022-06-07 11:54:04 +07:00
Alex Sharov
a53642b4bf
datadir.Dirs configuration object to group dir config (#4387) 2022-06-07 10:24:50 +07:00
ledgerwatch
b2f9b25300
For for overwritten anchor (#4379)
* For for overwritten anchor

* Switch to time types, log retry time in diagnostics

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-06 18:23:41 +01:00
Andrew Ashikhmin
f3575ce46a
Fix MarkAllVerified (#4380) 2022-06-06 18:22:08 +01:00
ledgerwatch
4a5f97527b
Better diagnostic for stuck headers (#4372)
* More stuck headers diagnostics

* Temp print

* Remove temp print

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-05 15:00:13 +01:00
ledgerwatch
1231f8c21c
Add bor mainnet to embed (#4370)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-05 11:39:27 +01:00
ledgerwatch
7132a90613
Add bor mainnet snapshot hashes (#4368)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-05 14:36:26 +05:30
Enrique Jose Avila Asapche
9f1cc40c89
changed syncmode flag to snapshots flag (#4353)
* changed syncmode flag to snapshots flag

* using boolT

* Remove syncmode concept

* Add mumbai

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-05 07:33:55 +01:00
Alex Sharov
f838268e44
[wip] Snapshots: more runtime invariants check (#4350) 2022-06-03 18:50:01 +07:00
Enrique Jose Avila Asapche
49292346b3
Auto correcting sync mode instead of giving an error (#4337) 2022-06-03 09:38:10 +01:00
ledgerwatch
bcbb8bec65
Try to prevent double block retire (#4330)
* Try to prevent double block retire

* Remove print

* More careful setting of segmentsMax

* Print snapshots max

* Clean lists

* Print

* Use Reopen

* Fix

* Remove prints

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-02 16:58:38 +01:00
Giulio rebuffo
f2be5a74a0
fixed it (#4336) 2022-06-02 15:54:11 +02:00
Enrique Jose Avila Asapche
bc21ab9d97
syncmode changes (#4334)
* log syncmode

* little comment

* ops

* calling log in correct place

* got rid of error instead we warn

* no return
2022-06-02 14:15:00 +01:00
ledgerwatch
b06b4b4c91
Prevent double retiring of the same interval, prevent hiding errors (#4325)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-02 08:49:24 +07:00
ledgerwatch
e0ac654da5
Better diagnostics for anchorQueue (#4326)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-06-01 23:45:06 +01:00
Giulio rebuffo
40230d5ab5
Refactor mining batch (#4322)
* refactooor

* updated ethdb

* more fixing

* more fixing

* more

* refactoor

* fixed mdbx crash
2022-06-01 22:48:42 +01:00
battlmonstr
0c5d1d64a3
observer: sentry candidates intake (#4321)
* sentry client: log connected peer info

* observer: unseen sentry peers report

* observer: refactoring node.go to node_utils

* observer: sentry candidates intake
2022-06-01 22:48:24 +01:00