Commit graph

431 commits

Author SHA1 Message Date
Nazarii Denha
7b75f163b0
feat(rpc): add scroll_getBlockByNumber (#413)
* add scroll_getBlockByNumber rpc api

* bump version

* fix

* bump version

* Update version.go

* Revert "Update version.go"

This reverts commit 1be1d9c4fdbb64254659ac193cffd23dbbacfb5e.

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2023-08-01 15:32:12 +02:00
Nazarii Denha
3943547960
feat(rawdb&rpc): add block row consumption rpc (#388)
* add db api for rowconsumption

* add rpc api for block row consumption

* return nil if rc is is not known

* add method to sdk

* bump version

* small fix

* update version

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-07-11 22:07:09 +08:00
Péter Garamvölgyi
38a6a1e964
fix: include L1MessageTx fields in transaction RPC result (#375)
* fix: include L1MessageTx fields in tx RPC result

* bump version
2023-06-30 15:52:57 +02:00
HAOYUatHZ
f055f50f9d
feat: update l1fee calculation (#351) 2023-06-13 10:57:59 +08:00
Péter Garamvölgyi
983d630244
feat: Sync and relay L1 messages (#350)
* add l1 config in genesis config (#249)

* add l1 config in genesis config

* fix lint

* Update params/config.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* extend node configuration (#251)

* extend node configuration

* use block number instead of hash

* accept safe, finalized and numbers for L1Confirmations

* fix typos

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* Fix/improve node config parsing (#260)

* raise error on failed parsing

* default value

* add l1-message-type, transaction methods (#252)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* txpool l1 check, pointer change, marhsal test

* draft: start implementing l1message gas behavior

* draft: start implementing l1message gas behavior

* change to gas usage

* error comment typo

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* goimports

* update nonce, add hash test (fails), marshal test

* goimports

* target addr cant be nil

* change call msg

* comment out test

* lint

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Add L1 message database (#255)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* add L1 message store to rawdb

* remove comments

* rename to l1_message

* rename variables and add comments

* write l1 msgs in a batch

* add more comments

* update tests

* allow batched and non-batched writes

* rename to accessors_l1_message

* handle error

* add range check

* fix tests

* update comments

* nit

* support blocks with 0 l1 messages

---------

Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269)

* deep copy value field, add tx hash test

comment

* typo

* Rename nonce to queueindex, increment sender nonce on L1 message execution (#271)

* change nonce to queueindex, increment nonce on L1 message

* fix db acccessors

* Update core/types/transaction_marshalling.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* Fix db inspect command (#276)

fix db inspect command

* Add l1 sync service (#256)

* extend node configuration

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* use block number instead of hash

* accept safe, finalized and numbers for L1Confirmations

* add L1 message store to rawdb

* remove comments

* fix typos

* add L1 message sync service

* use l1 contract address and chain ID

* use L1DeploymentBlock

* add confirmation config

* move bridge client to separate file

* use uint64 block number

* fix bigint comparison

* rename constants

* add more logs

* rename to l1_message

* rename variables and add comments

* write l1 msgs in a batch

* add more comments

* update tests

* allow batched and non-batched writes

* rename to accessors_l1_message

* handle error

* check if config is provided

* improve sync service DB batched writes

* add range check

* fix tests

* update comments

* nit

* fix flush range and improve comments

* solve circular dependency

* update stress tests

* initialize l1 client for geth

* start sync service

* add more comments

* check nil correctly

* address comments

* fix merge

* fix genesis l1config deserialization

* add sync progress logs

* initial sync

* handle leveldb not found error

* use errors.Is

* address comments

* update DefaultPollInterval

---------

Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* Add L1 message validation (#272)

* add L1 message validation

* add comments and better error handling

* handle leveldb not found error

* update incorrect condition for genesis block

* typo

* change inclusion index logic

* disable L1 message check for legacy tests

* set NumL1MessagesPerBlock to 0 in tests

* update default genesis config

* Add L1 msg validation tests (#303)

add L1 msg validation tests

* Update miner include l1 messages (#265)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* add L1 message store to rawdb

* add L1 message sync service

* remove comments

* use l1 contract address and chain ID

* extend node configuration

* use block number instead of hash

* accept safe, finalized and numbers for L1Confirmations

* fix typos

* use L1DeploymentBlock

* add confirmation config

* move bridge client to separate file

* use uint64 block number

* fix bigint comparison

* rename constants

* add more logs

* Fix/improve node config parsing (#260)

* raise error on failed parsing

* default value

* rename to l1_message

* rename variables and add comments

* write l1 msgs in a batch

* add more comments

* update tests

* allow batched and non-batched writes

* rename to accessors_l1_message

* handle error

* check if config is provided

* improve sync service DB batched writes

* include l1 messages in blocks: part 1

* add l1-message-type, transaction methods (#252)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* txpool l1 check, pointer change, marhsal test

* draft: start implementing l1message gas behavior

* draft: start implementing l1message gas behavior

* change to gas usage

* error comment typo

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* goimports

* update nonce, add hash test (fails), marshal test

* goimports

* target addr cant be nil

* change call msg

* comment out test

* lint

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Add L1 message database (#255)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* add L1 message store to rawdb

* remove comments

* rename to l1_message

* rename variables and add comments

* write l1 msgs in a batch

* add more comments

* update tests

* allow batched and non-batched writes

* rename to accessors_l1_message

* handle error

* add range check

* fix tests

* update comments

* nit

* support blocks with 0 l1 messages

---------

Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* build(docker): auto docker push when pushing git tags (#258)

* build(docker): update docker trigger tag prefix (#259)

* Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269)

* deep copy value field, add tx hash test

comment

* typo

* commitl1messages

* lint

* Revert "add L1 message sync service"

This reverts commit 5305e8a5de14766ed249e1a7d64042c7a72cf5c2.

* Revert "move bridge client to separate file"

This reverts commit 0b220bee37de93c3250545e23430db2c401a2f90.

* update branch

* use commitMessages for l1Txs

* little fix

* fix config

* fix test

* comment fixes

* fix

* fix config check

---------

Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* Add ErrUnknownAncestor tests (#305)

add ErrUnknownAncestor tests

* worker test include l1 msgs (#306)

* worker test include l1 msgs

* move L1 message index update next to block insertion

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* exclude l1 messages from transaction count limit in block (#307)

* exclude l1 messages from transaction count limit in block

* fix comments

* trigger ci

* nit

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* Expose queueIndex on Transaction (#316)

expose queueIndex on Transaction

* test that l1msg doesn't count in maxTxPerBlock limit (#312)

* test that l1msg doesn't count in maxTxPerBlock limit

* fix, comment

* retrigger ci

* change order inside test

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* reuse trace nonce field for queueIndex

* expose scroll APIs on the geth console

* add L1 message query APIs

* Trigger new block on new l1 messages (#343)

* trigger new block on new l1 messages

* typo

* initialize l1MsgCh

* fix worker l1msg tests (#345)

---------

Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>

* test(worker): ensure that l1 messages are included in the correct order (#346)

test that l1msgs added in correct order

* rename enqueueIndex --> queueIndex

* move QueueIndex into transaction

* improve l1 db interface

* formatting

* bump version

* print l1config

* add API to query latest included message queue index

* clean up tx limit logic

* add clarifying comments and todos to ValidateL1Messages

* improve db comments and logs

* clean up L1MessageTx type handling

* format

* format

* improve L1 message block check

* fix missing L1 event handling

* fix TestL1MessageValidationFailure

* simplify sync height resume logic

* make l1Config.l1MessageQueueAddress non-pointer

* improve command line flags

* remove todo

* use abigen tools for log filtering

* cache block L1 message count

* nit: fix variable name case

* improve logs

* flush pending writes to DB before shutdown

---------

Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2023-06-07 07:24:19 -07:00
maskpp
a89ab83089
fix(API): use hexutil.Big for l1Fee in GetTransactionReceipt (#336)
* It's not a bug, but if just translate to hexutil.Big can be better.

* Revert editor's auto change.

* Update version.

* Update version.
2023-05-22 16:52:13 +08:00
HAOYUatHZ
32aacc3fd6
style: revert some formatting (#294)
Revert "style: remove blank line & white space formatting"

This reverts commit 349def8d5d78f83c19e899d5d80b1d9f6a5d18c6.
2023-04-20 17:49:35 +08:00
HAOYUatHZ
11ff7a0648
refactor: rename L1FeeEnabled to FeeVaultEnabled (#281)
rename `L1FeeEnabled` to `FeeVaultEnabled`
2023-04-19 22:41:38 +08:00
Max Wolff
028acecb02
fix return type in tx receipt for l1fee type (#254)
* edit marshalling override

* goimports

* not required

* encode l1fee

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
2023-04-19 05:12:57 +02:00
HAOYUatHZ
df1d37e097
refactor(config): consolidate scroll flags (#262) 2023-04-17 18:56:26 +08:00
Péter Garamvölgyi
b986f1ea7b
feat(API): consider L1 fee in eth_call and eth_estimateGas (#248)
* consider L1 fee in eth_call and eth_estimateGas

* address comments

* consider l1fee in trace call

* nit

* fix bugs and add tests

* address comments

* bump version
2023-03-30 23:10:51 +08:00
Max Wolff
a74b35e86f
feat(api): add L1 fee to eth_getTransactionReceipt (#244)
* Update api.go

* fmt

* revert changes

* add l1fee to receipt in transaction processor

* decoder

* fmt

* fmt

* add encoding, test

* fmt

* removed duplicate l1 fee calc, added gen receipt

* remove dup l1feecalc

* lint

* add omitempty

* bump version

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-03-28 09:08:57 +08:00
maskpp
d1f9523b08
feat(build): Upgrade go version to 1.18 (#241)
* update go version

* update go version

* format code by goimports

* format code by goimports

* go mod tidy

* update go version

* update go version

* upgrade linter

* add exclude rule

* fix golangci exclude

---------

Co-authored-by: vincent <419436363@qq.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-03-06 13:32:39 +08:00
Péter Garamvölgyi
3fcd77955e
fix GetTransactionReceipt crash when BaseFee is missing (#224) 2023-02-21 18:23:18 +01:00
Nazarii Denha
310c870c6a
set BaseFee to nil (#222)
* set BaseFee to nil

* fix lint

* comment fix

* update genesis.go
2023-02-20 22:04:55 -08:00
Péter Garamvölgyi
81e7775aa8
feat: dual code hash (#188)
* add KeccakCodeHash and CodeSize to StateAccount

* update StateAccount marshalling logic

* change emptyCodeHash to poseidon(nil)

* purge StateAccount.hash

* fix/disable failing tests

* change keccak and poseidon hash order in StateAccount

* fix lint

* update l2trace account wrapper

* update eth_getProof response type

* fix eth_getProof response type

* goimports

* update the codehash computation

* update the codehash test cases

* go mod tidy

* fix tests

* use keccak instead of poseidon

* update trace codehash field name

* upgrade zktrie to 4.2

* trigger ci

* update state account marshalling according to spec

* improve generatorStats estimation

* add comment

* upgrade zktrie to 4.3

* go mod tidy

* misc fixes

* fix TestDump

* fix snap sync tests

* handle err in the codehash

* fix tests in snapshot/generate_test.go

* remove prevhash from state journal

* add state_account_marshalling_test.go

* goimports

* add more tests

---------

Co-authored-by: Ho Vei <noelwei@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2023-02-08 16:12:41 -08:00
Zhang Zhuo
1fe2d22e29
feat: make eip2718 & eip1559 configurable in txpool (#206)
* txpool only supports legacy tx

* configurable tx pool EIP-2718 && EIP-1559

* try fix CI

* fix CI

* fix metamask incompatibility

* fix comments

* fix CI

* set basefee as 0 when disable eip2718 or eip1559

* fix typo

---------

Co-authored-by: colinlyguo <colinlyguo@gmail.com>
2023-02-03 14:24:15 +08:00
maskpp
22963a115d
feat(trace): Add header and upgrade TransactionTrace (#181)
* Add header and upgrade TransactionTrace

* Add header

* change blockResult struct

* rm chainID from TransactionData

* Rename blockResult to blockTrace in everywhere

* fix comments
2022-11-18 17:11:04 +08:00
Steven
ee913fa40c
Replace utesting/blocktraces with git-submodule test-traces (#170)
* Replace `utesting/blocktraces` with git-submodule `test-traces`.

* Fix to package utesting.

* Update git-submodile `blocktraces` and update path in test code.
2022-10-31 13:34:20 +08:00
Ho
4ee7885525
Fix witness generator for failed call/create op and tx (#146)
* update test examples

* update tests

* solidify account deleting

* update zkwriter for reverting

* solid handling for call, and update test examples

* fix status capture for CREATE issue, update test examples

* add fail case for deploy

* update test example (call non-exist address)

* move test and stuffs to internal path, make required exports

* fix issue in selfdestruct

* update destruct test

* lint

* rename traces
2022-10-10 17:13:24 +08:00
maskpp
15391eeaf7
feat: add replay blockResult API (#139)
* replay trace

* replay trace

* add sdk

* fix trace test case

* fix bug

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* add comments

* fail the rpc call if get error

* adjust channel length

* fix bug

* fix bug

* remove redundant codes in worker

* add test case

* fix bug

* fix goimports

* Update eth/tracers/api_blockResult.go

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* fix comments

* Update ethclient/ethclient.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update ethclient/ethclient.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* rm coinbase api in miner

* fix comment

* Update eth/tracers/api.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* fix comment

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2022-09-20 14:30:57 +08:00
Péter Garamvölgyi
304af60f50
feat: change bytecode hash function from Keccak to Poseidon (#149)
* feat: change bytecode hash function from Keccak to Poseidon

* fix TestStateProcessorErrors

* rename files

* copy iden3's poseidon package to local

* update poseidon hash

* apply new hash in codehash

* extend hash method, use actual code size as cap

* prune keccak(nil) for empty code

* update empty code hash references to Poseidon

* add TestPoseidonCodeHash

* use keccak for empty code hash

* go mod tidy

* goimports

* use Poseidon code hash in state and sync tests

* run goimports

* run goimports

* remove unnecessary reallocation from CodeHash

* goimports

* move codehash API to separate module

* add missing package

* fix review comments

* improve comments

Co-authored-by: Ho Vei <noelwei@gmail.com>
2022-09-08 06:16:17 +08:00
Ho
fefa8b99c7
fix getProof API when zktrie is enabled (#132)
fix getProof under zktrie
2022-07-27 13:01:38 +08:00
Ho
3682e05f3f
zktrie part3: include zktrie witness in block trace; add demo for generating witness data for mpt circuit (#123)
* demo for witness generator

* add simple binary for witness generating

* revert the witgen utility

* purge some code

* induce mptwitness argument

* handle case for failed tx, and special block in POA

* mptwitness: refactor for enabling output ops with different order

* induce witness gen with rwtable order

* self-documenting options for mptwitness

* fix trace flag according to review

* fix issue in handling failed tx

* refactor

* update according to reviews

Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2022-07-16 07:00:07 +08:00
Steven
b6cc89fabe
Add goimports lint (#54)
* Add `goimports` lint.

* Fix `goimports` issue.

* Fix group to `github.com/scroll-tech/go-thereum`.
2022-03-24 16:53:59 +08:00
maskpp
2040f8c781
Fix bug about genesis file struct (#32)
* Fix bug about genesis file struct

* Add test case if custom genesis file

* Add test case if custom genesis file

* Fix a mistake

* Update Makefile

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2022-02-23 00:01:59 -08:00
maskpp
7745fd5840
Extract execution trace from EVM execution and provide subscription API (#19)
* Create go.yml

* Merge from zkrollup and fix conflict

* go mod tidy

* fix worker_test test case

* fix worker_test test case

* Delete go.yml

* add log content, enable memory trace

* add tracer pool handler

* Add comments and format code

* add evmTrace subscribe api

* Move the evmTrace struct.

* Fix miner bug.

* upgrade evmTrace api

* fix bug about evmTracesByHash api

* Fix the bug about block.timestamp and remove unnecessary copy.

* Update eth/filters/api.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Upgrade comments.

* Delete useless code in test file

* Update miner/worker.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Change the return result to BlockResult.

* Change return type.

* Change blockResult to blockResults.

* Add ReturnValue.

* Update core/rawdb/l2trace.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update core/rawdb/l2trace.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update core/types/l2trace.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Add indent to the comment and rm json encoding flag.

* Rm json encoding flag.

* Update core/rawdb/l2trace.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Rm json encoding flag.

* Update ethclient/ethclient.go

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* Update eth/filters/api.go

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* Use  as the blockResult prefix flag.

* Update eth/filters/filter_system.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/filters/filter_system.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update ethclient/ethclient.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/filters/api.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2022-01-23 20:41:15 +08:00
maskpp
b4d60884d2
Fix import fmt and run tests for given architecture (#18)
* fix gofmt

* Run tests for given architecture

* Speed up CI execution.
2022-01-12 19:45:06 -08:00
Jules
de7ed6af40
Update mod file and all imports to use scroll-tech URL (#15)
* Update mod file and all imports to use scroll-tech URL

Fixes #14

* Update Discord link
2021-12-24 10:59:22 +01:00
Marius van der Wijden
433f0919cc
internal/ethapi: fix recover sender of pending transaction (#23765)
* internal/ethapi: fix recover sender of pending transaction

* internal/ethapi: check if current exists
2021-10-18 20:53:08 +02:00
Felix Lange
f9d683b07f
go.mod: upgrade goja (#23721)
This update adds support for some more ES6 functionality, notably
arrow functions.
2021-10-13 14:42:00 +02:00
noam-alchemy
633e7ef478
eth,rpc: allow for flag configured timeouts for eth_call (#23645)
* eth,rpc: allow for flag configured timeouts for eth_call

* lint: account for package-local import order

* cr: rename `rpc.calltimeout` to `rpc.evmtimeout`
2021-10-12 10:46:04 +02:00
Aditya Arora
a6a0609b05
internal/jsre: handle null and undefined to prevent crash (#23701)
This prevents the console from crashing when auto-completing on
a variable or property that is null or undefined.

Fixes #23693
2021-10-10 14:58:47 +02:00
Sina Mahmoodi
48496e0675
internal/ethapi: use correct signer when serving old blocks (#23683)
Fixes #23681

After the fix I get the address 0x6d6d02e83c4ced98204e20126acf27e9d87b8af2 for the
tx mentioned in the ticket, which agrees with etherscan.
2021-10-07 15:51:14 +02:00
Martin Holst Swende
edb1937cf7
core: improve shutdown synchronization in BlockChain (#22853)
This change removes misuses of sync.WaitGroup in BlockChain. Before this change,
block insertion modified the WaitGroup counter in order to ensure that Stop would wait
for pending operations to complete. This was racy and could even lead to crashes
if Stop was called at an unfortunate time. The issue is resolved by adding a specialized
'closable' mutex, which prevents chain modifications after stopping while also
synchronizing writers with each other.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-10-07 15:47:50 +02:00
Martin Holst Swende
307156cc46
eth/api: add rpc method to obtain which states are accessible (#23646)
This PR adds a method to the debug namespace, to iterate over the blocks and check where we have the roots on disk.
2021-10-05 08:13:00 +02:00
Péter Szilágyi
5240725041
internal/ethapi: make header/block rlp retrieval canonical 2021-10-03 16:47:51 +03:00
Péter Szilágyi
07a5bc1b0b
internal/ethapi: support retrieving header RLPs too 2021-10-01 11:47:29 +03:00
Martin Holst Swende
ab2caaee11
eth/tracers: implement debug.intermediateRoots (#23594)
This PR implements a new debug method, which I've talked briefly about to some other client developers. It allows the caller to obtain the intermediate state roots for a block (which might be either a canon block or a 'bad' block).
2021-09-28 12:53:11 +02:00
Péter Szilágyi
9bf495bfc9
internal/debug: make gosimple linter happy 2021-09-20 18:55:35 +03:00
Péter Szilágyi
e28f713ada
internal: support optional filter expression for debug.stacks (#23605)
* internal: support optional filter expression for debug.stacks

* internal/debug: fix string regexp

* internal/debug: support searching for line numbers too
2021-09-20 16:29:07 +03:00
Péter Szilágyi
9e17648d8c
les: duplicate downloader and fetcher to allow progressive refactoring 2021-09-10 11:11:59 +03:00
Zachinquarantine
ca5bc676d1
internal/debug: remove deprecated flags (#23368)
* internal/debug: remove deprecated flags

The removed flags are removed in the main portion of geth, this removes it internally too.

* internal/debug: remove legacy --debug and legacy --backtrace flag

* Update flags.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-09-07 10:51:33 +02:00
Martin Holst Swende
4d88974864
cmd/evm: add tests for evm t8n (#23507) 2021-09-02 09:22:43 +02:00
lightclient
ffae2043f0
internal/ethapi: support both input and data for personal_sendTransaction (#23476)
Currently, setDefaults overwrites the transaction input value if only input is provided. This causes personal_sendTransaction to estimate the gas based on a transaction with empty data. eth_estimateGas never calls setDefaults so it was unaffected by this.
2021-08-27 14:11:15 +02:00
Martin Holst Swende
62ad17fb00
Revert "eth, internal/ethapi: make RPC block miner field show block sealer correctly (#23312)" (#23466)
This reverts commit 57feabea66.
2021-08-26 08:35:37 +02:00
Felix Lange
8a134014b4
all: add go:build lines (#23468)
Generated by go1.17 fmt ./...
2021-08-25 18:46:29 +02:00
Marius van der Wijden
d02c605367
core: only check sendernoeoa in non fake mode (#23424) 2021-08-23 12:49:39 +03:00
陈佳
57feabea66
eth, internal/ethapi: make RPC block miner field show block sealer correctly (#23312)
Makes the RPC block return the POA sealer for clique blocks on the 'miner' field (was previously zeroes)
2021-08-17 18:55:18 +02:00
Martin Holst Swende
278ec7176a
internal/ethapi: add back missing check for maxfee < maxPriorityFee 2021-08-12 08:14:21 +02:00