Commit graph

217 commits

Author SHA1 Message Date
colin
d2fe42ba8f
internal/ethapi: eth_call block parameter is optional (#28165) (#1095)
* internal/ethapi: eth_call block parameter is optional (#28165)

So apparently in the spec the base block parameter of eth_call is optional.
I agree that "latest" is a sane default for this that most people would use.

* chore: auto version bump [bot]

---------

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com>
2024-12-03 14:32:37 +08:00
Morty
9fff27e4f3
fix(api): change gas_price to use pending block (#1082)
* fix(api): change gas_price to use pending block
2024-10-29 16:07:33 +08:00
Ömer Faruk Irmak
521a074f60
feat: allow removing txns from pool via CLI/RPC (#1041) 2024-09-16 13:56:11 +03:00
Ömer Faruk Irmak
50a6bc6f42
feat: make descartes a timestamp based fork (#852)
* feat: make descartes a timestamp based fork

* chore: auto version bump [bot]

---------

Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
2024-06-26 12:35:04 +08:00
Péter Garamvölgyi
81074f58d8
feat: implement eth_getBlockReceipts (#796)
* internal/ethapi: implement eth_getBlockReceipts (#27702)

* chore: auto version bump [bot]

* chore: auto version bump [bot]

---------

Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Thegaram <Thegaram@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
2024-06-05 15:19:57 +02:00
Péter Garamvölgyi
bfe803001b
feat: update L1 data fee in Curie hard fork (#755)
* update fee calculation

* add missing GPO slots to trace

* add placeholder for contract update logic

* nit

* update fee calculation

* update formula

* update GPO slots

* update L1GPO bytecode

* apply Curie in new worker

* move bytecode to config

* create an empty block for curie hard fork

* initialize L1GasPriceOracle storage slots

* add comments

* add test

* add IsCurie to traces and tests

* group GPO storage slots into a struct

* update unit test

* chore: auto version bump [bot]

* trigger ci

* update bytecode

* remove leading 0x

* update comments

* include rollup fee tests in CI

---------

Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
Co-authored-by: Thegaram <Thegaram@users.noreply.github.com>
2024-05-28 14:12:39 +02:00
Péter Garamvölgyi
0f0cd99f7a
feat: update upcoming fork names (#680)
* feat: update upcoming fork names

* bump version

* Apply suggestions from code review

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

* bump version

---------

Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
2024-03-26 14:41:32 +00:00
Péter Garamvölgyi
ccec84ce63
feat: re-enable EIP-1559 in Banach hard fork (#634)
* feat: re-enable EIP-1559 in Banach hard fork

* enable BASEFEE opcode

* do not double gas limit on Banach fork block

* do not burn base fee

* update base fee calculation logic

* fix gas price oracle

* fix ethapi backend

* typo

* reorder worker code

* update genesis base fee

* add MaximumL2BaseFee

* add base fee metrics

* handle nil base fee

* revert state-transition change

* bump version

* remove TODO

* update test

* fix typo

* fix typo

* update traces

* fix test

* update london to banach

* handle error

* bump version

* bump version
2024-03-11 13:57:52 +00:00
colin
a807a41fd1
fix(txJSON): L1 message type MarshalJSON (#630)
* fix(txJSON): L1 message type MarshalJSON

* address comments

* bump version

* trigger ci

* bump version

* bump version
2024-03-05 20:12:10 +08:00
colin
bbf42042e2
fix: eth_estimateGas error in zero balance address (#537)
* fix: eth_estimateGas zero balance error

* bump version

* revert irrelevant auto format

* remove isEstimateGas in DoCall

* fix CI

* bump version

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
2023-10-25 11:52:40 +02:00
Péter Garamvölgyi
7de261b1be
feat: store skipped transactions in local db (#467)
* feat: store skipped txs in local db

* bump version

* bump version

* fix test

* include L2 txs in skipped index

* goimports

* rename more

* bump version

* fix missed renames

* fix the bug when calculating l2TxCount. (#479)

* fix bug when calculate l2 tx count

* Update version

* fix: exclude L1 message from block payload size validation (#476)

* fix: exclude L1 message from block payload size validation

* fix the bug when calculating l2TxCount. (#479)

* fix bug when calculate l2 tx count

* Update version

* bump version

---------

Co-authored-by: maskpp <maskpp266@gmail.com>

* fix: update row estimation with scroll-prover `v0.7.2` (#475)

* Fix row estimation.

* Update libzkp.

* more

* prepare

* finish

* upgrade

* bump version

* fix tests

* Update to scroll-prover `v0.7.2`.

* fix tests

* Update miner/worker.go

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

* Update miner/worker.go

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

* Reset ccc when skips first tx.

* do not unnecessarily skip L1 message

* fix ccc reset and improve code readability

* seal block on circuitcapacitychecker.ErrUnknown

---------

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

* refactor: simplify ccc revert to snapshot (#480)

* simplify ccc revert to snapshot

* Update version.go

---------

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

* feat: use --gcmode=archive and --cache.noprefetch=true by default (#482)

* feat: use --gcmode=archive and --cache.noprefetch=true by default

* refuse to start with invalid config

* lint

* lint

* feat(sdk): support compressed response (#469)

* enable use compression algorithm

* fix ci

* Just enable decode compressed content at ethclient

* fix comments

---------

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

* fix: disable pruning and prefetch if not flags are provided (#483)

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

* fix: update libzkp to use scroll-prover `v0.7.5` (#484)

* Update libzkp to use scroll-prover `v0.7.5`.

* Update version.

* address comments

* bump version

* nit

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Steven <asongala@163.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: iczc <iczcalan@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
2023-08-25 15:41:05 +02: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
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
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
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
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
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
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
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