* feat: add EIP-7702
* fix goimport
* add unit tests
* add api test
* sync txpool update
* update generated code
* make code readable
* fix goimport
* fix TestAsyncChecker unit test
* add AuthorizationList in fuzz tests for completeness sake
* add EuclidV2 test, EIP-7702 transaction in TestT8n
* clean up logs
* bump version
* fix TestAsyncChecker
* Revert "fix TestAsyncChecker"
This reverts commit 314478303d4a504a3948bd6595568916ba7d82f0.
* accept eip-7702 txns only after enabling eip-7702
* revert IntrinsicGas param name from setCodeAuthorizations to authList
* fix a bug
* align upstream implementation in Encoding Receipts
* fix one test case
* fix tracer
* return precode copy
* support setcode tx in EstimateGas and add unit tests
* add TestValidateAuthorizations
* poseidon hash fix
* migrate a fix before the fix pr is merged
* support setcode type transactions in TransactionData
* chore: auto version bump [bot]
* add a nonce-gapped-auth-does-not-block-pending-tx unit test
* make the auth invalid
* Apply suggestions from code review
* change usedAndLeftSlots and knownConflicts to util functions
* add comments about different return of applyAuthorization
* remove gencodec:required in transaction signatures
* fix goimport
* update StructLogger and AccessListTracer
* fix a bug
* fix flaky test
---------
Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
* 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>
* feat: support blob transaction
* sync tx encoding/decoding
* more fixes
* add uint236 support in rlp encoding decoding
* revert a format change
* trigger ci
* 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>
* 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>
This fixes a bug in TransactionSender where it would return the
zero address for transactions where the sender address wasn't
cached already.
Co-authored-by: Felix Lange <fjl@twurst.com>
* ethclient/gethclient: fix flaky test (due to map key ordering)
* accounts/keystore: fix test failing due to rand collision due to low time resolution on windows
* 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>
This commit adds the package gethclient which is similar to the ethclient
and implements some geth specific functionality.
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* accounts/abi/bind: fix bounded contracts and sim backend for 1559
* accounts/abi/bind, ethclient: don't rely on chain config for gas prices
* all: enable London for all internal tests
* les: get receipt type info in les tests
* les: fix weird test
Co-authored-by: Martin Holst Swende <martin@swende.se>
The wantErr field was disused, and the error returned by HeaderByNumber
was not properly tested.
This simplifies the error checking using errors.Is and asserts that getting
an expected missing header returns ethereum.NotFound. Also adds a nil
check condition for header.Number before using big.Int's Sign method.
This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.
There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.
The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID.
This change also adds support for the YoloV3 testnet.
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
This moves the eth config definition into a separate package, eth/ethconfig.
Packages eth and les can now import this common package instead of
importing eth from les, reducing dependencies.
Co-authored-by: Felix Lange <fjl@twurst.com>
This commit extends the ethclient test suite and increases code coverage of the ethclient
package from ~15% to >55%. These tests act as early smoke tests to signal issues in the
RPC-interface. E.g. if a functionality like eth_chainId or eth_call breaks, the test
will break.
This PR significantly changes the APIs for instantiating Ethereum nodes in
a Go program. The new APIs are not backwards-compatible, but we feel that
this is made up for by the much simpler way of registering services on
node.Node. You can find more information and rationale in the design
document: https://gist.github.com/renaynay/5bec2de19fde66f4d04c535fd24f0775.
There is also a new feature in Node's Go API: it is now possible to
register arbitrary handlers on the user-facing HTTP server. In geth, this
facility is used to enable GraphQL.
There is a single minor change relevant for geth users in this PR: The
GraphQL API is no longer available separately from the JSON-RPC HTTP
server. If you want GraphQL, you need to enable it using the
./geth --http --graphql flag combination.
The --graphql.port and --graphql.addr flags are no longer available.
This change makes getBalance, getCode, getStorageAt, getProof,
call, getTransactionCount return an error if the block number in
the request doesn't exist. getHeaderByNumber still returns null
for missing headers.
ethereum/go-ethereum#16734 introduced BlockHash to the FilterQuery
struct. However, ethclient was not updated to include BlockHash in the actual
RPC request.
The error produced when using a Parity RPC was the following:
ERROR: transaction did not get mined: failed to get tx for txid 0xbdeb094b3278019383c8da148ff1cb5b5dbd61bf8731bc2310ac1b8ed0235226: json: cannot unmarshal non-string into Go struct field txExtraInfo.blockHash of type common.Hash
* core/types: make Signer derive address instead of public key
There are two reasons to do this now: The upcoming ethclient signer
doesn't know the public key, just the address. EIP 208 will introduce a
new signer which derives the 'entry point' address for transactions with
zero signature. The entry point has no public key.
Other changes to the interface ease the path make to moving signature
crypto out of core/types later.
* ethclient, mobile: add TransactionSender
The new method can get the right signer without any crypto, and without
knowledge of the signature scheme that was used when the transaction was
included.
As per #14661 TransactionByHash always returns false for pending.
This uses blockNumber rather than blockHash to ensure that it returns
the correct value for pending and will not suffer side-effects if
eth_getTransactionByHash is fixed in future.
There is no need to depend on the old context package now that the
minimum Go version is 1.7. The move to "context" eliminates our weird
vendoring setup. Some vendored code still uses golang.org/x/net/context
and it is now vendored in the normal way.
This change triggered new vet checks around context.WithTimeout which
didn't fire with golang.org/x/net/context.
This significantly reduces the dependency closure of ethclient, which no
longer depends on core/vm as of this change.
All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too,
the constructor simply returned a literal.