Commit Graph

541 Commits

Author SHA1 Message Date
ledgerwatch
2d1d71153a
Update eth_call.go 2022-03-12 00:16:18 +00:00
leonardchinonso
14b300214a
Feature/test event logs (#3631)
* Adding contract code for event logs subscription

* Saving changes

* gofmt'd files

* Setting up devnet test tool for log subscription testing

* Fixed lint errors

* Changes to debug case

* fixed linting

* Committing debugging changes

* Finalised contract tx creation and mining

* Fixed lint errors

* Made base fee upper limit a constant
2022-03-09 22:45:24 +00:00
Alex Sharov
0b2ce6f845
rpcdaemon: limit amount of read transactions (#3637)
* 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

* 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

* a

* a

* a

* a

* a

* a

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* fefefe

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2022-03-08 10:43:14 +07:00
Enrique Jose Avila Asapche
dd47dfdf09
typo and code consistency (#3651) 2022-03-07 10:24:21 +07:00
Andrew Ashikhmin
4607179849
Handle a corner case in forkchoiceUpdated (#3640)
* Fix typo

* fix typos

* Handle corner case when unwinding to geneis

* No-op ForkChoice
2022-03-03 16:09:03 +01:00
Andrew Ashikhmin
f58e80bd56
Expose eth API on the same ports as engine API (#3633)
* Expose port 8551 (authenticated Engine API)

* Expose eth API on the same ports as engine API
2022-03-02 14:58:46 +01:00
battlmonstr
47df98a499
Use "err" key for logging errors. (#3632)
log.Warn/Error uses "err" key to log errors in most places.
This renames "error" to "err" in some places to adhere to this convention.
2022-03-01 15:40:51 +00:00
Enrique Jose Avila Asapche
a65f12b248
State override support (#3628)
* added stateOverride type

* solved import cycle

* refactoring

* imported wrong package

* fixed Call arguments

* typo

* override for traceCall
2022-03-01 15:40:24 +00:00
Giulio rebuffo
cb8aacae87
Added Engine Authentication [JWT] (#3531)
* jwt

* fuuuuture

* added auth

* merge

* merge

* Update jwt to the latest version

* ops

* comments

* cleanup

* bad

* gut

* maybe

* mod sum

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-02-28 12:07:09 +01:00
Giulio rebuffo
99f688c3ec
PrevRandao Renaming (#3616)
* PrevRandao Renaming

* lint
2022-02-24 18:16:05 +01:00
ledgerwatch
ee488020dd
Auto detect latest block for optimal use of plain state and state cache (#3598)
* Auto detect latest block for optimal use of plain state and state cache

* Fix lint

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-23 23:42:14 +00:00
Andrew Ashikhmin
37ccbc53d6
Refactor payload building (#3592)
* Bump MaxPendingPayloads

* UnknownPayload error

* Improve ExchangeTransitionConfigurationV1 comment

* Extract MakeEmptyHeader

* Move MakeEmptyHeader to chain_makers

* Start with empty block as pending payload

* Only build payloads with the right parent hash

* Double check parent hash in SpawnMiningCreateBlockStage

* Simpler error formatting

* ReadHeadBlockHash instead of ReadHeadHeaderHash

* Avoid rebuilding already built blocks

* getPayload should stop the build process

* Tweaking stageLoopIsBusy

* Don't update pending payload after engine_getPayload
2022-02-23 21:27:38 +01:00
Enrique Jose Avila Asapche
198f021f33
Better inputs (#3590)
* updated tests

* using rpc.Timestamp

* added Timestamp type
2022-02-23 13:52:19 +00:00
ledgerwatch
7397af57d4
Optimise eth_getStorageAt for current state (#3580)
* Optimise eth_getStorageAt for current state

* Fix

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-23 09:44:55 +00:00
battlmonstr
e6c056e666
Rename Datadir/dataDir to follow conventions. (#3576)
* rename from Datadir to DataDir (functions and public vars)
* rename dataDir to datadir (local variables)
2022-02-22 17:39:48 +00:00
Giulio rebuffo
b49381821f
Fixed get-payload and Hanging ForkChoice (#3575)
* done

* removed sleep

* f

* errors.Is(err, io.EOF) instead of err == io.EOF

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-02-22 14:47:23 +01:00
ledgerwatch
266625f56a
Fixes to access list and state overrides (#3570)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-22 10:29:02 +00:00
Alex Sharov
b08cb44353
embed rpcdaemon: enable it only by --http flag (#3574) 2022-02-22 16:23:54 +07:00
Enrique Jose Avila Asapche
231255f026
correct naming (#3563) 2022-02-22 08:42:23 +07:00
Andrew Ashikhmin
980276c322
Fix coinbase in stage_mining_exec (#3564)
* Simplify TerminalBlockHash & TerminalBlockNumber

* Simplify FeedHeaderPoS

* More accurate comment

* Relax TerminalBlockHash check

* Extract the sleep hack into stageLoopIsBusy

* Several short naps instead of a single longish sleep

* Fix coinbase in stage_mining_exec

* More orthodox loop

* typo in comment
2022-02-21 18:05:39 +01:00
Alex Sharov
bed56c6363
Embed rpcdaemon - more cli flags (#3556)
* more rpc emed flags

* more rpc emed flags

* more rpc emed flags
2022-02-21 09:32:42 +07:00
Enrique Jose Avila Asapche
d12560f1b5
Get block by time stamp (#3514)
* initial

* binary search through blocks

* snapshot

* returning highest block

* oldest block is now 0

* multiple test written for  getBlockByTimeStamp

* retrieved picked block time stamp

* added into erigon_api

* returning pointer

* reverting c37b99b2d7ebc2250b103393378cc4a4f94a6c21

* deleted print

* proper rpc block response

* fixing test

* returning lowest block

* lint

* typo

* fixed test

* returning lowest-1

* skip while loop for times too big or small

* added to readme

* using sort.Search
2022-02-20 10:45:29 +00:00
bernard-wagner
58d2118c10
rpcdaemon: added debug_traceBlockByNumber and debug_traceBlockByHash (#3548) 2022-02-19 08:15:27 +00:00
Alex Sharov
b60faba5d9
more stable grpc err chec (#3541) 2022-02-18 09:54:38 +07:00
Alex Sharov
3de83e2d96
RPCDaemon: to start with disabled txpool (#3539) 2022-02-18 09:45:20 +07:00
Alex Sharov
226982d293
Use class dir.Rw - to separate Ro and Rw access to snapshotDir (#3534)
* save

* save

* save

* save

* save

* save

* save
2022-02-18 09:24:17 +07:00
Andrew Ashikhmin
0701c83222
Fix stall on unwind in handleForkChoice (#3536)
* ReadHeader instead of ReadHeaderByHash

* Add Engine API to rpcdaemon README

* Fix nil pointer dereference in HandlePendingBlock

* Fix latestValidHash JSON

* Delete GetPayloadBodiesV1

* Break infinte unwind loop in handleForkChoice

* More logging
2022-02-17 18:30:57 +01:00
Alex Sharov
18989d73e6
RPCDaemon: --txpool.api.addr by default to use value of --private.api.addr #3532 2022-02-17 09:06:22 +07:00
alex.sharov
89f3164653 Revert "save"
This reverts commit 3ac9112df1.
2022-02-17 09:04:23 +07:00
alex.sharov
3ac9112df1 save 2022-02-17 09:02:32 +07:00
Omer Korner
eabc2da6db
Fix typo (#3529) 2022-02-16 18:42:00 +00:00
Alex Sharov
237a7d24d0
Embed RPCDaemon (#3522)
* save

* save

* save

* save

* save
2022-02-16 17:38:54 +00:00
Andrew Ashikhmin
7bad3a9c59
state.PlainState is now at the beginning of blockNbr, not the end (#3517)
* state.PlainState is now at the beginning of blockNbr, not the end (fix discprepancy with GetAsOf)

* Fix tests
2022-02-16 08:38:12 +00:00
Alex Sharov
6d9ea162ab
rpc daemon embed (step 3) (#3519) 2022-02-16 11:24:51 +07:00
Enrique Jose Avila Asapche
089a1dd5e7
adding engine_ExchangeTransitionConfigurationV1 (#3454) 2022-02-15 09:30:54 +00:00
Andrew Ashikhmin
64f4de50cd
Optimized eth_createAccessList (#3453)
* Make blockNrOrHash optional in CreateAccessList (in line with geth)

* OptimizedAccessList

* cosmetics

* optimizeGas param instead of separate method

* Inline toAddress
2022-02-14 18:39:45 +00:00
Andrew Ashikhmin
b3905fb659
Fix rpcdaemon: borDb may be nil (#3512) 2022-02-14 13:00:54 +01:00
alex.sharov
d488482c89 save 2022-02-13 08:53:10 +07:00
Alex Sharov
c9cee7a884
path -> filepath (path package is for urls) (#3493) 2022-02-12 20:33:09 +07:00
Alex Sharov
479c7f3d9d
Embed rpcdaemon: prepared direct clients (#3492) 2022-02-12 19:47:19 +07:00
leonardchinonso
aca755ab43
Fix/rpcdaemon ws upgrade (#3490)
* Added a method to `cmd/rpcdaemon/cli/config.go` to check header of incoming http request for a ws upgrade request

* Added the testing of the 'GET /' request for ws to the devnet tool

* Fixed lint errors
2022-02-12 12:40:19 +01:00
Alex Sharov
a1318f869a
make services net-independent (#3481) 2022-02-11 17:11:59 +07:00
Alex Sharov
ccf434f270
GetTransactionByHash: fallback to txpool (#3463)
* GetTransactionByHash: fallback to txpool

* GetTransactionByHash: fallback to txpool
2022-02-10 08:36:24 +00:00
Alex Sharov
e695a6e58b
state and newHead: 1 goroutine per subscriber (#3452) 2022-02-10 08:25:58 +07:00
Andrew Ashikhmin
8466cb1b7b
New Engine API semantics (Kiln v1) (#3340)
* Disable PoS sync temporarily

* Resore PoS sync

* Handle Ctrl^C in HeadersPOS

* Consistent naming

* Extract verifyAndSavePoSHeader & downloadMissingPoSHeaders

* Preparation for EngineForkChoiceUpdated re-orgs

* Extract ForkingPoint

* Comments

* New proto for Engine API

* EngineExecutePayload -> EngineNewPayload

* Return INVALID_BLOCK_HASH if block hash is invalid

* Return EngineStatus_ACCEPTED for side chain blocks

* Update erigon-lib (PR 268)

* Fix payload2Hash

* reverseDownloadCh -> beaconPayloadCh

* Update erigon-lib

* Engine API updated

* ExecutionStatus -> PayloadStatus

* Introduce forkChoiceCh

* Mock ForkChoiceMessage/PayloadStatus

* Add ValidationError to PayloadStatus

* Small clean-ups

* Add INVALID_TERMINAL_BLOCK to EngineStatus

* Add a comment

* Extract handleNewPayload & handleForkChoice

* Partially implement handleForkChoice

* Update erigon-lib

* short vs long re-org

* Move header insertion out of downloadMissingPoSHeaders

* Update erigon-lib

* Refactor ProcessSegmentPOS

* Fix imports

* Wire downloadMissingPoSHeaders into handleForkChoice

* evictOldPendingPayloads

* nolint:unused for assertSegment

* Try nolint instead of nolint:unused

* Small comment improvements

* HeadHeaderHash/StageProgress in handleForkChoice

* TODO: bodyDownloader.AddToPrefetch(block)

* Review call suggestions

* Don't use ReadHeaderNumber in ProcessSegmentPOS

* Don't leave ethbackend waiting when server is stopping

* Update erigon-lib

* More explicit signature of downloadMissingPoSHeaders
2022-02-09 08:33:22 +01:00
alex.sharov
863db147cf bor: ensure db exists 2022-02-09 09:31:12 +07:00
Alex Sharov
e5081c78b9
bor: ensure db exists (#3449) 2022-02-09 09:28:06 +07:00
primal_concrete_sledge
60f4b3a46d
fix/add_4th_parameter_to_parity_list (#3443)
* fix/add_4th_parameter_to_parity_list

* Change blocknum type from interface{} to rpc.BlockNumberOrHash

* Change latest block check
2022-02-08 13:02:18 +00:00
Enrique Jose Avila Asapche
35fcd3a829
Merging Turbo bor into devel (#3372)
* implemented bor consensus

* add bor flags to default

* change bucket into snapshot to clique

* enable stateSync

* bypass reciept checks

* fix receipt calculation and bor logs

* fix: contract call wrt bor

* Update mumbai config

* Add: bor-mainnet flag and config

* Add bor consensus to integration

* use header coinbase in block context

* london fork mumbai changes

* fix genesis error

* Jaipur fork for mumbai

* add sysCall to verifyHeader

* added bor related rpc method implementation

* added bor specific rpc extensions

* fixes in snapshot implementation, major refactor for bor rpc

* modify consensus specific db path for bor

* fix: remove parallel compute for get root hash rpc method

* Added bor-receipt flow

* Use turbo-bor-lib and bor tables

* Use bor table in RPC snapshot

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* update rpc readme

* link rpc docs in readme

* Update Readme

* Update Readme

* move erigon namespace rpc methods to eth

* rm: erigon namespace

* rm: erigon namespace, update list of available rpc methods, add example

* fix: binary name in rpc readme

* fix: max db size

* Add london to bor-mainnet

* updated node.go

* add system req to readme

* golang version fix readme

* added networknames in correct place

* nil

* ran gofmt

* erigon

* fixed fake.go

* dont need turbor-lib

* old readme

* fixing readme

* half

* other half

* changed return

* fixing return

* fixed return

* fixed flags

* gofmt

* merge with devel

* latest erigon-lib

* fixed context.coinbase

* took out syscall

* fixed params in hash

* bor type now is consensus.Engine

* parlia is consensus.Engine

* missing arg and repeated importation

* repeated importation

* fixed eth_receipts.go

* deleted duplicate issuance

* part of consensus.Engine type

* added eth_api issuance

* networkname

* added erigon_system file

* fork struct taken out

* added erigon block

* getLogByHash for erigonImpl

* gofmt

* fixed lint

* ops

* gofmt

* gofmt

* added APIImple functions

* fixed clique test

* took out print

* fixed state added balance

* fixed README

* fixed rpcDaemon README

* fixed integration README

* updated blockchain.go

* lint

* added bor back into blockchain.go

* took out comment

* lint

* updated daemon

* updated wtb

* removed duplicate

* removed VerifyHeaders

* prevent use of wrong Transfer

* fixed state_processor.go

* fixed state_transition.go

* fixed headers

* returning err

* error handling in bor read tx look up

* put for txLookUp

* dealing with error

* lint

* traces

* more traces

* fixed receipt in execution

* getTrasanction receipt for bor or others

* nil

* lint

* ops

* deleted syscall

* took out else

* Merge branch 'devel

* tests syscalls

* changed borReceipt to receipt

* reset header algos

* arguments fix

* took out prefixes

* lint

* erigon-named

* borReceiptKey = blocknumber

* reverts e3b60c2e159d03efcb855f7ab3da5a098dd60c33.

* correct hashing tx

* dont need it here

* lint

* added txlookup for bor

* change to uint256

* outputs for isBor

* wrapper

* added isBor and isParlia

* isBor

* fixed BorTransfer

* not readBody

* correct prefix

* added blockNum

* added readStorageBody

* readStorageBody

* lint

* got rid of unnecessary bor_receipt func

* onlny if bor

* use clone

* append

* writeToSlice

* added isBor flag

* fixed writeToSlice

* normal sorting

* lint

* Reset erigon-snapshots

* Move bor prefix into if

Co-authored-by: Krishna Upadhyaya <krishnau1604@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Uttam Singh <uttamkhanduja@yahoo.in>
Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-02-07 21:30:46 +00:00
Alex Sharov
29a4adfbaa
ParallelCompressor: Remove intermediate ETL collectors (#3427)
* save

* save

* save
2022-02-04 16:48:16 +07:00