Commit Graph

16213 Commits

Author SHA1 Message Date
Alex Sharov
5d68f610bc
mdbx: use OS pagesize by default (but > 4Kb, and < 64Kb) #4743 2022-07-19 10:40:02 +07:00
nanevardanyan
59dda48567
eth: replace maps with etl.Collectors (#4707)
* WIP: eth: replace maps with etl.Collectors

* WIP: eth: replace maps with etl.Collectors in pruneOldLogChunks

* WIP: eth: use appendBuffer to avoid duplicates

* WIP: eth: replace with oldestEntrySortableBuffer
2022-07-19 08:11:37 +07: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
b7acf6c108
compressor: generic sort (#4734) 2022-07-18 17:12:13 +07:00
Alex Sharov
15ca3d25c1
snapshots: mainnet to 15m #4733 2022-07-18 15:36:53 +07:00
Alex Sharov
13bf5c30c1
db migration fix: it was able run with delay #4732 2022-07-18 14:38:01 +07:00
Alex Sharov
ac9b7d8cc2
commitment: generic btree #4731 2022-07-18 12:19:46 +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
Enrique Jose Avila Asapche
e04401491f
checking if we build torrent file (#4723)
* checking if we build torrent file

* only if torrentHash != nil

* clearer separation of scenario

* refactored Download

* comments

* ops

* not using magnet with empty hash

* moved log to top

* ops

* logs

* log warns

* bumped up log lvl

* log
2022-07-16 11:06:26 +03:00
Levi Aul
b6440eea1e
Add erigon_getBalanceChangesInBlock RPC endpoint (#4609)
* Add eth_getBalanceChangesInBlock RPC endpoint

* Fix lints

* added assertion for one test

* moved balance change api from eth to erigon

Co-authored-by: fatemebagherii <fa.bagheri.a@gmail.com>
2022-07-15 16:04:23 +02:00
Max Revitt
e8f83db208
Gas api unit tests (#4715)
* gas price initial unit tests

* tweak(makefile): gas price test timeout increase

increase test timeout in Makefile to 50s from 30s
to cater for increased test time unit testing
gas price logic.

Co-authored-by: Scott Fairclough <scott@hexosoft.co.uk>
2022-07-15 14:56:35 +02:00
Alex Sharov
92e2311eb3
docker compose: fix interpolation format #4722 Open 2022-07-15 14:39:27 +07:00
Alex Sharov
7b57e26d84
grafana: up security fix version #4721 2022-07-15 13:57:44 +07:00
Alex Sharov
f18a5b0864
integration to pass mdbx.Accede flag (#4719) 2022-07-15 13:17:07 +07:00
Giulio rebuffo
759e77c71b
mod (#4717) 2022-07-14 19:08:33 +02:00
Enrique Jose Avila Asapche
793ffcce3b
separated interrupt logic (#4714) 2022-07-14 17:22:46 +03:00
Max Revitt
07e00b878c
use nested datadir/network path for db supporting legacy (#4713)
Co-authored-by: Scott Fairclough <scott@hexosoft.co.uk>
2022-07-14 12:30:50 +02:00
Max Revitt
211dbfbb75
fix(#4543): BeginRo use semaphore (erigon-lib bump) (#4712) 2022-07-14 12:01:57 +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
af58e427f1
Ensure no in-memory execution when --experimental.overlay=false (#4708)
* Ensure no in-memory execution when --experimental.overlay=false

* bump log level

* canExtendInMemory -> canExtendFork

* forgot to FeedHeaderPoS

* small simplification
2022-07-13 19:54:43 +02:00
Zachinquarantine
8c27879a6b
Remove NewKeyedTransactor function (#4472)
* accounts/abi: remove NewKeyedTransactor function

* Remove "imported and not used" package

* Update state.go

* Update statedb_insert_chain_transaction_test.go

* Update statedb_chain_test.go

* Update database_test.go

* lint fixes

Co-authored-by: awskii <artem.tsskiy@gmail.com>
2022-07-13 17:40:39 +07:00
Alex Sharov
36586e52a1
Torrent: add fsync after piece download (#4700) 2022-07-13 17:39:20 +07:00
Andrew Ashikhmin
dd1a5944a9
Better logging for invalid PoS headers (#4703) 2022-07-13 12:07:21 +02:00
Alex Sharov
ed42f98a98
backward compatibility: use default UID=1000 GID=1000 (#4702)
* backward compatibility: use default UID=1000 GID=1000

* backward compatibility: use default UID=1000 GID=1000
2022-07-13 14:45:00 +07:00
Andrew Ashikhmin
991d65c0d3
Remove old Gnosis boot nodes (#4699) 2022-07-13 09:37:01 +02:00
primal_concrete_sledge
cd5ef32f37
Add config for Gnosis Chain (#4671)
* Draft: gnosis-chain

* Fix Gnosis allocation

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-07-12 17:21:52 +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
Andrew Ashikhmin
e0845f229b
Don't feed invalid headers into DB (#4693)
* Reduce code duplication in verifyAndSaveNewPoSHeader

* Don't feed invalid headers into DB

* remove superfluous comment
2022-07-12 10:33:43 +02:00
Artem Tsebrovskiy
9637b25a42
[erigon2] print trie variant derived from trie instead switch log (#4672)
* [erigon2] print trie variant derived from trie instead switch log

* updated erigon-lib version

* bumped erigon-lib version
2022-07-11 15:58:08 +01: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
nanevardanyan
d8b2077aef
eth: divide test cases and verify with exact values (#4691) 2022-07-11 13:56:00 +02:00
Leonard Chinonso
8a75033b98
returned error if error object is not nil (#4685)
* returned error if error object is not nil

* undefined block: changed it to blockNumber
2022-07-10 08:13:24 +06:00
Leonard Chinonso
cfc051892e
Fix for issue 4205 (optimize eth_getLogs) (#4662)
* optimize eth_getLogs

* used the implementation from api._blockReader

* used the implementation from api._blockReader
2022-07-09 19:42:57 +06:00
Cory
0ca3ff3858
Fix regex (#4678) 2022-07-09 11:56:23 +06: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
Giulio rebuffo
63f6eab6c7
removed envelope on txpool for PoS (#4683) 2022-07-08 16:48:24 +02: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
d54a007289
Enable in-memory overlay by default (#4680) 2022-07-08 12:05:57 +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
Cory
9f5b401547
Fix grafana startup in docker-compose (#4677)
* grafana user 472:0

* Fix typo extra ~ in Makefile

* Create grafana dir correctly

* chown -R
2022-07-08 12:11:07 +06: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
Igor Mandrigin
024061018e
Fix a deadlock under RPC load (#4667)
* debugs

* rename logs

* updated erigon lib with the attempt to fix deadlock

* Update erigon-lib that fixes the deadlock

* Revert "rename logs"

This reverts commit 13b6ac555314ce4317de2438d5f1a5e883343865.

* Revert "debugs"

This reverts commit 356de6c8ef3df2a440f8ad6c18ccb63496d8256d.

* revert unnecessary change

* go mod tidy

Co-authored-by: Igor Mandrigin <i@mandrigin.ru>
2022-07-07 08:34:51 +01: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
Andrew Ashikhmin
71525fa85e
safeAndFinalizedBlocksAreCanonical -> writeForkChoiceHashes (#4655)
* safeAndFinalizedBlocksAreCanonical -> writeForkChoiceHashes

* fix
2022-07-06 14:42:33 +02:00
hexoscott
b84867f13b
adding health endpoint documentation for headers (#4656) 2022-07-06 14:22:32 +02:00