Commit Graph

14054 Commits

Author SHA1 Message Date
Martin Holst Swende
eca3d39c31
p2p/discover: pass invalid discv5 packets to Unhandled channel (#26699)
This makes it possible to run another protocol alongside discv5, by reading 
unhandled packets from the channel.
2023-03-14 12:40:40 +01:00
rjl493456442
c8a6b7100c
core/state, trie: port changes from PBSS (#26763) 2023-03-14 04:50:53 -04:00
Felix Lange
94ff721911
.travis.yml: reenable PPA build on tag push (#26873) 2023-03-13 14:10:19 +01:00
lightclient
5f81db68c6
eth: return error if 'safe' or 'finalized' tag used pre-merge (#26862)
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-13 06:51:23 -04:00
ucwong
d1c5f918a3
core/txpool: use priceList.Put instead of heap.Push (#26863)
Minor refactor to use the 'intended' accessor
2023-03-13 04:45:25 -04:00
s7v7nislands
a20e38720c
core: minor code refactor (#26852)
* core: refactor code

* core: drop it from this anonymous goroutine func
2023-03-13 04:02:50 -04:00
xiyang
ca61048178
code/vm: fix comment typo (#26865)
it should be constantinople rather than contantinople
2023-03-13 09:30:32 +02:00
Guruprasad Kamath
789de23d16
tests: define MuirGlacier fork (#26856)
add muir glacier to t8n
2023-03-10 15:47:05 -05:00
Felix Lange
4930614a09 params: begin v1.11.5 release cycle 2023-03-10 20:00:23 +01:00
Felix Lange
7e3b149be0 params: go-ethereum v1.11.4 stable 2023-03-10 19:53:52 +01:00
Marius van der Wijden
6cf2e921a7
core/txpool: implement additional DoS defenses (#26648)
This adds two new rules to the transaction pool:

- A future transaction can not evict a pending transaction.
- A transaction can not overspend available funds of a sender.

---

Co-authored-by: dwn1998 <42262393+dwn1998@users.noreply.github.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-03-10 18:30:26 +01:00
Felix Lange
564db9a95f
core: add Timestamp method in BlockGen (#26844)
Since forks are now scheduled by block time, it can be necessary
to check the timestamp of a block while generating transactions.
2023-03-10 14:03:27 +01:00
panicalways
051493d9bf
p2p: small comment typo (#26850)
Update server.go
2023-03-10 11:45:49 +02:00
Péter Szilágyi
df02799543
travis: only build PPAs nightly, not on every push, too heavy (#26846) 2023-03-09 16:44:54 +02:00
Roberto Bayardo
67ac5f0ae7
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.

This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).

The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.

Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.

By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 14:19:12 +01:00
Martin Holst Swende
08f6a2a89d
cmd/evm: update readmes for the tests (#26841) 2023-03-09 07:06:47 -05:00
Felix Lange
5395362e0f
core/forkid: fix issue in validation test (#26544)
This changes the test to match the comment description. Using timestampedConfig in this test case is incorrect, the comment says 'local is at Gray Glacier' and isn't aware of more forks.
2023-03-09 06:37:44 -05:00
xiyang
1bf1168432
core/vm: fix typo in comment (#26838)
fixes eip 220 ->  2200
2023-03-09 04:39:17 -05:00
Martin Holst Swende
b80f05bde2
core/vm: use golang native big.Int (#26834)
reverts #26021, to use the upstream bigint instead.
2023-03-08 13:12:53 -05:00
Rafael Matias
e14043db71
params: remove EF azure bootnodes (#26828) 2023-03-08 11:13:56 +01:00
Daniel Fernandes
02796f6bee
signer/core: accept all solidity primitive types for EIP-712 signing (#26770)
Accept all primitive types in Solidity for EIP-712 from intN, uintN, intN[], uintN[] for N as 0 to 256 in multiples of 8

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-03-08 02:48:53 -05:00
rjl493456442
f7661a662a
core/rawdb: find smallest block stored in key-value store when chain gapped (#26719)
This change prints out more information about the problem, in the case where geth detects a gap between leveldb and ancients, so we can determine more exactly where the gap is (what the first missing is). Also prints out more metadata. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-03-08 02:39:13 -05:00
Felix Lange
bb4ac2d396 params: begin v1.11.4 release cycle 2023-03-07 18:18:59 +01:00
Felix Lange
5ed08c4735 params: go-ethereum v1.11.3 stable 2023-03-07 18:17:32 +01:00
Felix Lange
a54d91ac5a
build: update to go 1.20.2 (#26824) 2023-03-07 18:16:21 +01:00
Marius van der Wijden
78429f7733
beacon/engine: don't omit empty withdrawals in ExecutionPayloadBodies (#26698)
This ensures the "withdrawals" field will always be present in responses
to getPayloadBodiesByRangeV1 and getPayloadBodiesByHashV1.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-07 16:30:04 +01:00
James Prestwich
1e3177de22
accounts/usbwallet: mitigate ledger app chunking issue (#26773)
This PR mitigates an issue with Ledger's on-device RLP deserialization, see
https://github.com/LedgerHQ/app-ethereum/issues/409

Ledger's RLP deserialization code does not validate the length of the RLP list received,
and it may prematurely enter the signing flow when a APDU chunk boundary falls immediately
before the EIP-155 chain_id when deserializing a transaction. Since the chain_id is
uninitialized, it is 0 during this signing flow. This may cause the user to accidentally
sign the transaction with chain_id = 0. That signature would be returned from the device 1
packet earlier than expected by the communication loop. The device blocks the
second-to-last packet waiting for the signer flow, and then errors on the successive
packet (which contains the chain_id, zeroed r, and zeroed s)

Since the signature's early arrival causes successive errors during the communication
process, geth does not parse the improper signature produced by the device, and therefore
no improperly-signed transaction can be created. User funds are not at risk.

We mitigate by selecting the highest chunk size that leaves at least 4 bytes in the
final chunk.
2023-03-07 15:20:04 +01:00
Sina Mahmoodi
41af42e97c
eth/tracers/native: set created address to nil in case of failure (#26779)
Fixes #26073
2023-03-07 14:39:11 +01:00
Guruprasad Kamath
cb1f6bdbc8
cmd/evm: correct alloc for t8n testdata (#26822)
Fixes a minor error in the testdata
2023-03-07 05:32:52 -05:00
Adrian Sutton
39be753bf5
internal/ethapi: add tests for transaction types JSON marshal/unmarshal (#26667)
Checks that Transaction.MarshalJSON and newRPCTransaction JSON output can be parsed by Transaction.UnmarshalJSON

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-03-07 05:26:19 -05:00
rjl493456442
77e33e5a49
core, miner: revert block gas counter in case of invalid transaction (#26799)
This change fixes a flaw where, in certain scenarios, the block sealer did not accurately reset the remaining gas after failing to include an invalid transaction. Fixes #26791
2023-03-07 05:23:52 -05:00
Felix Lange
4688d3c8f4
ethclient: fix panic when requesting missing blocks (#26817)
This fixes a regression introduced by #26723.
Fixes #26816.
2023-03-07 05:21:23 -05:00
turboboost55
544e4a700b
metrics: improve accuracy of CPU gauges (#26793)
This PR changes metrics collection to actually measure the time interval between collections, rather
than assume 3 seconds. I did some ad hoc profiling, and on slower hardware (eg, my Raspberry Pi 4)
I routinely saw intervals between 3.3 - 3.5 seconds, with some being as high as 4.5 seconds. This
will generally cause the CPU gauge readings to be too high, and in some cases can cause impossibly
large values for the CPU load metrics (eg. greater than 400 for a 4 core CPU).

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-07 00:29:48 +01:00
Marius van der Wijden
5bc2ef984f
core, eth/catalyst: fix race conditions in tests (#26790)
Fixes a race in TestNewPayloadOnInvalidTerminalBlock where setting the TTD raced with
the miner. Solution: set the TTD on the blockchain config not the genesis config.

Also fixes a race in CopyHeader which resulted in race reports all over the place.
2023-03-06 23:32:27 +01:00
Felix Lange
87186148e0
core/types: add EffectiveGasPrice in Receipt (#26713)
This change adds a struct field EffectiveGasPrice in types.Receipt. The field is present
in RPC responses, but not in the Go struct, and thus can't easily be accessed via ethclient.

Co-authored-by: PulsarAI <dev@pulsar-systems.fi>
2023-03-06 17:19:41 +01:00
Péter Szilágyi
4c23fe97c5
eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
Marius van der Wijden
d865a5d6ae
core, params: schedule Shanghai on goerli (#26795)
* core: params: schedule Shanghai on goerli

* core/forkid: fix comment
2023-03-06 09:26:43 +02:00
Péter Szilágyi
27e59827d8 travi: remove strange leftover Go version 2023-03-03 12:26:04 +02:00
Péter Szilágyi
403cac71eb
README, go.mod, event, internal/version: bump min Go to 1.19 (#26803) 2023-03-03 12:24:09 +02:00
Péter Szilágyi
010189538e
core: fix a merge fault (#26802) 2023-03-03 12:11:39 +02:00
Péter Szilágyi
19f74fa3c0
core/rawdb, ethdb/pebble: disable pebble on openbsd (#26801) 2023-03-03 12:05:00 +02:00
Péter Szilágyi
cd31f2dee2
all: change chain head markers from block to header (#26777) 2023-03-02 08:29:15 +02:00
Peter (bitfly)
e1b98f49a5
ethclient: include withdrawals in ethclient block responses (#26778)
* include withdrawals in ethclient responses

* omit empty withdrawals array in json serialization
2023-02-28 15:40:24 +02:00
rjl493456442
2bb622ce40
ethdb/pebble: fix max memorytable size (#26776) 2023-02-28 15:34:12 +02:00
rjl493456442
98b0ea62b5
ethdb/pebble: fix range compaction (#26771)
* ethdb/pebble: fix range compaction

* ethdb/pebble: add comment
2023-02-28 15:32:51 +02:00
Dan Cline
2ea48f8a22
core: improve withdrawal index assignment in GenerateChain (#26756)
This fixes an issue where the withdrawal index was not calculated correctly
for multiple withdrawals in a single block.

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-02-28 11:46:32 +01:00
Chris Ziogas
2ad150d986
eth/tracers: add native flatCallTracer (aka parity style tracer) (#26377)
Adds support for a native call tracer with the Parity format, which outputs call frames
in a flat array. This tracer accepts the following options:

- `convertParityErrors: true` will convert error messages to match those of Parity
- `includePrecompiles: true` will report all calls to precompiles. The default
  matches Parity's behavior where CALL and STATICCALLs to precompiles are excluded

Incompatibilities with Parity include:

- Parity removes the result object in case of failure. This behavior is maintained
  with the exception of reverts. Revert output usually contains useful information,
  i.e. Solidity revert reason.
- The `gasUsed` field accounts for intrinsic gas (e.g. 21000 for simple transfers)
  and refunds unlike Parity
- Block rewards are not reported

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-02-28 13:54:37 +03:30
Martin Holst Swende
c155c8e179
cmd/devp2p: faster crawling + less verbose dns updates (#26697)
This improves the speed of DHT crawling by using concurrent requests.
It also removes logging of individual DNS updates.
2023-02-27 11:36:26 +01:00
Péter Szilágyi
ee530c0d5a
Merge pull request #26721 from holiman/nocover
ci: disable coverage reporting in appveyor and travis
2023-02-23 13:24:31 +02:00
Péter Szilágyi
b3ae073488
eth: use the last announced finalized block as the sync ancient limit (#26685) 2023-02-23 13:22:41 +02:00