Commit Graph

211 Commits

Author SHA1 Message Date
lightclient
ae8ce72022
internal/ethapi: fix chain ID check to return all non-zero IDs (#25244) 2022-07-07 21:50:28 +02:00
Sina Mahmoodi
cb7f35996d
internal/ethapi: add basefee to block overrides (#25219) 2022-07-05 14:48:34 +02:00
Seungbae.yu
2697e44d81
all: change format 0x%x to %#x (#25221) 2022-07-04 11:03:32 +03:00
lightclient
3e693e1ef6
internal/ethapi: return chain id for EIP-155 legacy txs (#25155) 2022-06-29 11:58:59 +02:00
lightclient
c7f485d9e5
internal/ethapi: add note about eth_chainId compatibility with EIP-695 (#25168)
Co-authored-by: Felix Lange <fjl@twurst.com>
2022-06-25 21:34:21 +02:00
lightclient
647c6f2db6
internal/ethapi: always return chain id (#25166)
The error was introduced in PR #21686, but there is no good reason to enforce sync
in this method, and it causes issues with EL/CL integration.
2022-06-24 18:03:13 +02:00
lightclient
10dc5dce08
all: remove concept of public/private API definitions (#25053)
* internal/ethapi: rename PublicEthereumAPI to EthereumAPI

* eth: rename PublicEthereumAPI to EthereumAPI

* internal/ethapi: rename PublicTxPoolAPI to TxPoolAPI

* internal/ethapi: rename PublicAccountAPI to EthereumAccountAPI

* internal/ethapi: rename PrivateAccountAPI to PersonalAccountAPI

* internal/ethapi: rename PublicBlockChainAPI to BlockChainAPI

* internal/ethapi: rename PublicTransactionPoolAPI to TransactionAPI

* internal/ethapi: rename PublicDebugAPI to DebugAPI

* internal/ethapi: move PrivateDebugAPI methods to DebugAPI

* internal/ethapi: rename PublicNetAPI to NetAPI

* les: rename PrivateLightServerAPI to LightServerAPI

* les: rename PrivateLightAPI to LightAPI

* les: rename PrivateDebugAPI to DebugAPI

* les: rename PublicDownloaderAPI to DownloaderAPI

* eth,les: rename PublicFilterAPI to FilterAPI

* eth: rename PublicMinerAPI to MinerAPI

* eth: rename PublicDownloaderAPI to DownloaderAPI

* eth: move PrivateMinerAPI methods to MinerAPI

* eth: rename PrivateAdminAPI to AdminAPI

* eth: rename PublicDebugAPI to DebugAPI

* eth: move PrivateDebugAPI methods to DebugAPI

* node: rename publicAdminAPI to adminAPI

* node: move privateAdminAPI methods to adminAPI

* node: rename publicWeb3API to web3API

* eth,internal/ethapi: sync comments with previous renamings
2022-06-21 12:05:43 +03:00
Sina Mahmoodi
d39f0cce71
internal/ethapi: remove SignAndSendTransaction (#25111) 2022-06-20 10:38:46 +02:00
Kosuke Taniguchi
ba99e19215
internal/ethapi: add comment explaining return of nil instead of error (#25097)
Co-authored-by: Felix Lange <fjl@twurst.com>
2022-06-16 17:08:25 +02:00
lmittmann
bc013bc42e
all: prefer new(big.Int) over big.NewInt(0) (#25087)
minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`
2022-06-14 15:09:48 +03:00
Luozhu
3f5b5ec3e5
internal/ethapi: fix typo in comment (#25056)
typo error: keccack256 -> keccak256
2022-06-10 10:57:32 +02:00
Martin Holst Swende
d8a2305565
eth/tracers: add support for block overrides in debug_traceCall (#24871)
This PR adds support for block overrides when doing debug_traceCall.

- Previously, debug_traceCall against pending erroneously used a common.Hash{} stateroot when looking up the state, meaning that a totally empty state was used -- so it always failed,
- With this change, we reject executing debug_traceCall against pending.
- And we add ability to override all evm-visible header fields.
2022-06-02 11:39:36 +02:00
Martin Holst Swende
57192bd0dc
ethdb/remotedb, cmd: add support for remote (readonly) databases (#24836)
* ethdb/remotedb, cmd: add support for remote (readonly) databases

* ethdb/remotedb: minor changes

* ethdb/remotedb: close the conn

* cmd, ethdb: add rpc accessor for ancient data

* internal/ethapi: license

* ethdb/remotedb: linter fixes
2022-05-18 17:27:17 +03:00
Ryan Schneider
ae7d834bc7
internal/ethapi: add debug_getRawReceipts RPC method (#24773)
Adds a method to retrieve all the binary encoded receipts from a block
2022-05-14 22:33:41 +02:00
Sina Mahmoodi
5b46f1d1eb
internal: drop TestSignCliqueBlock (#24837) 2022-05-10 10:46:26 +02:00
Sina Mahmoodi
16701c5169
internal/ethapi: add db operations to api (#24739)
Adds `debug_dbGet` method to rpc api
2022-04-27 08:37:48 +02:00
Sina Mahmoodi
fb3a081c7e
eth/tracers: refactor traceTx to separate out struct logging (#24326)
* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes
2022-04-06 09:34:18 +02:00
Zhang Zhuo
b5a129ea24
internal/ethapi: add refund to StructLogRes (#24567)
* internal/ethapi: add refund to StructLogRes

* Update internal/ethapi/api.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2022-03-29 22:34:10 +02:00
b1ackd0t
f01e2fab07
internal/ethapi: fix incorrect type on empty slice (#24372)
* Fixes #24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-02-15 10:44:22 +01:00
Denver
06e16de894
internal/ethapi: remove unnecessary comment (#24271)
Because there is no `fullTx` parameter at function signatures and
uncle apis does not return txs also, those lines are un-necessary.
2022-01-24 06:43:51 +02:00
Marius van der Wijden
b1e72f7ea9
core/evm: RANDOM opcode (EIP-4399) (#24141)
* core: implement eip-4399 random opcode

* core: make vmconfig threadsafe

* core: miner: pass vmConfig by value not reference

* all: enable 4399 by Rules

* core: remove diff (f)

* tests: set proper difficulty (f)

* smaller diff (f)

* eth/catalyst: nit

* core: make RANDOM a pointer which is only set post-merge

* cmd/evm/internal/t8ntool: fix t8n tracing of 4399

* tests: set difficulty

* cmd/evm/internal/t8ntool: check that baserules are london before applying the merge chainrules
2022-01-10 09:44:21 +02:00
Péter Szilágyi
c10a0a62c3
eth: request id dispatcher and direct req/reply APIs (#23576)
* eth: request ID based message dispatcher

* eth: fix dispatcher cancellation, rework fetchers idleness tracker

* eth/downloader: drop peers who refuse to serve advertised chains
2021-11-26 13:26:03 +02:00
Sina Mahmoodi
1876cb443b
all: move loggers to eth/tracers (#23892)
* all: mv loggers to eth/tracers

* core/vm: minor

* eth/tracers: tmp comment out testStoreCapture

* eth/tracers: uncomment and fix logger test

* eth/tracers: simplify test

* core/vm: re-add license

* core/vm: minor

* rename LogConfig to Config
2021-11-25 14:17:09 +02: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
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
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
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
Péter Szilágyi
9e17648d8c
les: duplicate downloader and fetcher to allow progressive refactoring 2021-09-10 11:11:59 +03: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
陈佳
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
lightclient
a879c42bd3
internal/ethapi, accounts/abi/bind: cap highest gas limit by account balance for 1559 fee parameters (#23309)
* internal/ethapi/api: cap highest gas limit by account balance for 1559 fee parameters

* accounts/abi/bind: port gas limit cap for 1559 parameters to simulated backend

* accounts/abi/bind: add test for 1559 gas estimates for the simulated backend

* internal/ethapi/api: fix comment

* accounts/abi/bind/backends, internal/ethapi: unify naming style

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-08-10 16:56:34 +03:00
lightclient
39fe7eca6b
internal/ethapi: return maxFeePerGas for gasPrice for EIP-1559 txs (#23345) 2021-08-10 16:39:06 +03:00
Felföldi Zsolt
97bd6cd216
internal/ethapi: accept both hex and decimal for blockCount (#23363) 2021-08-10 09:53:40 +03:00
gary rong
f311488d2c
internal/ethapi: fix trace log marshalling (#23292) 2021-08-03 17:32:13 +02:00
Marius van der Wijden
2faf796d2a
internal/ethapi: fix panic in accesslist creation (#23225)
* internal/ethapi: revert + fix properly in al tracer

* internal/ethapi: use toMessage instead of creating new message

* internal/ethapi: remove ineffassign

* core: fix invalid unmarshalling, fix test

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-28 14:21:35 +02:00
lightclient
bbfa6488ac
Use hexutil.Uint for blockCount parameter in feeHistory method (#23239)
* internal/ethapi/api: use hexutil.uint for blockCount parameter instead of int for feeHistory

* return hex value for oldestBlock instead of number

* return uint64 from oracle.resolveBlockRange

* eth/gasprice: fixed test

Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2021-07-27 05:27:28 +02:00
Mark
c49e065fea
internal: get pending and queued transaction by address (#22992)
* core, eth, internal, les, light: get pending and queued transaction by address

* core: tiny nitpick fixes

* light: tiny nitpick

Co-authored-by: mark <mark@amis.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-07-13 13:40:58 +03:00
gary rong
846badc480
internal/ethapi: fix transaction APIs (#23179)
* internal/ethapi: fix transaction APIs

* internal/ethapi: fix typo

* internal/ethapi: address comments

* internal/ethapi: address comment from Peter
2021-07-13 13:40:01 +03:00
Péter Szilágyi
dea71556cc
eth/gasprice, internal/ethapi, miner: minor feehistory fixes 2021-07-08 21:50:35 +03:00
Martin Holst Swende
f5f906dd0d
eth/tracers: improve tracing performance (#23016)
Improves the performance of debug.traceTransaction
2021-07-01 09:15:04 +02:00
Marius van der Wijden
e7c8693635
internal/ethapi: fix panic in access list creation (#23133)
Fixes test failure in the last commit.
2021-06-30 14:23:20 +02:00
Felföldi Zsolt
35dbf7a8a3
eth/gasprice: implement feeHistory API (#23033)
* eth/gasprice: implement feeHistory API

* eth/gasprice: factored out resolveBlockRange

* eth/gasprice: add sanity check for missing block

* eth/gasprice: fetch actual gas used from receipts

* miner, eth/gasprice: add PendingBlockAndReceipts

* internal/ethapi: use hexutil.Big

* eth/gasprice: return error when requesting beyond head block

* eth/gasprice: fixed tests and return errors correctly

* eth/gasprice: rename receiver name

* eth/gasprice: return directly if blockCount == 0

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2021-06-28 16:16:32 +02:00
lightclient
97ce6dfa6d
internal/ethapi: fix typo in comment (#23057) 2021-06-18 12:16:34 +02:00
Péter Szilágyi
aa69d36152
core, graphql, internal: expose effectiveGasPrice in receipts 2021-06-16 09:52:06 +03:00
Péter Szilágyi
f68a68a313
core, internal: support various eth_call invocations post 1559 2021-06-10 08:02:51 +03:00
Péter Szilágyi
c503f98f6d
all: rename internal 1559 gas fields, add support for graphql (#23010)
* all: rename internal 1559 gas fields, add support for graphql

* cmd/evm/testdata, core: use public 1559 gas names on API surfaces
2021-06-08 12:05:41 +02:00
Martin Holst Swende
5cff9754d7
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader

* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results

* core,eth,les,internal: add support for tip estimation in gas price oracle

* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap

* core/types,internal: use correct eip1559 terminology for json marshalling

* eth, internal/ethapi: fix rebase problems

* internal/ethapi: fix rpc name of basefee

* internal/ethapi: address review concerns

* core, eth, internal, les: simplify gasprice oracle (#25)

* core, eth, internal, les: simplify gasprice oracle

* eth/gasprice: fix typo

* internal/ethapi: minor tweak in tx args

* internal/ethapi: calculate basefee for pending block

* internal/ethapi: fix panic

* internal/ethapi, eth/tracers: simplify txargs ToMessage

* internal/ethapi: remove unused param

* core, eth, internal: fix regressions wrt effective gas price in the evm

* eth/gasprice: drop weird debug println

* internal/jsre/deps: hack in 1559 gas conversions into embedded web3

* internal/jsre/deps: hack basFee to decimal conversion

* internal/ethapi: init feecap and tipcap for legacy txs too

* eth, graphql, internal, les: fix gas price suggestion on all combos

* internal/jsre/deps: handle decimal tipcap and feecap

* eth, internal: minor review fixes

* graphql, internal: export max fee cap RPC endpoint

* internal/ethapi: fix crash in transaction_args

* internal/ethapi: minor refactor to make the code safer

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 16:13:10 +03:00
aaronbuchwald
05dab7f6bd
internal/ethapi: remove unused vm.Config parameter of DoCall (#22942) 2021-05-26 08:39:41 +02:00
gary rong
51b32cc7e4
internal/ethapi: merge CallArgs and SendTxArgs (#22718)
There are two transaction parameter structures defined in
the codebase, although for different purposes. But most of
the parameters are shared. So it's nice to reduce the code
duplication by merging them together.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-05-25 22:30:21 +02:00