Commit Graph

3073 Commits

Author SHA1 Message Date
Giulio rebuffo
2294c8c66c
EthereumExecutionService in MockSentry (#8373)
Now we use the ethereum execution service directly:

* Changed sig of InsertChain
* Use of the service in case of PoS
2023-10-05 18:30:19 +02:00
Andrew Ashikhmin
0bd6d77acd
Remove CalcuttaBlock in favour of BlockAlloc (#8371)
System contract upgrades for Polygon are already handled by the
`BlockAlloc` logic and there's no need to duplicate it with the
`CalcuttaBlock` logic (there's no Calcutta in
https://github.com/maticnetwork/bor).
2023-10-05 15:39:57 +02:00
Alex Sharov
c4399da0f1
evm: no interface on contract creation (#8378) 2023-10-05 13:42:20 +07:00
Alex Sharov
c293883ec0
evm: no interface (#8376)
after removal of tevm experiment - we left interfaces everywhere 
removing it for performance and for geth compatibility
2023-10-05 12:23:08 +07:00
Jason Yellick
5654ba07c9
Upgrade libp2p (enables go 1.21 support) (#8288)
Closes #8078 

This change is primarily intended to support go 1.21, but as a
side-effect requires updating libp2p, which in turn triggers an update
of golang.org/x/exp which creates quite a bit of (simple) churn in the
slice sorting.

This change introduces a new `cmp.Compare` function which can be used to
return an integer satisfying the compare interface for slice sorting.

In order to continue to support mplex for libp2p, the change references
github.com/libp2p/go-libp2p-mplex instead. Please see the PR at
https://github.com/libp2p/go-libp2p/pull/2498 for the official usptream
comment that indicates official support for mplex being moved to this
location.

Co-authored-by: Jason Yellick <jason@enya.ai>
2023-09-29 22:11:13 +02:00
Alex Sharov
664a58a1db
log skipped files (#8297) 2023-09-28 08:56:37 +07:00
Alex Sharov
5641b52be0
evm: less defers in interpreter (#8179) 2023-09-25 08:53:04 +07:00
Alex Sharov
a22ab813af
evm: simplify addToAccessList methods (#8280) 2023-09-25 08:52:51 +07:00
Andrew Ashikhmin
94ec54e7a5
Implement EIP-7516: BLOBBASEFEE opcode (#8231)
[EIP-7516](https://eips.ethereum.org/EIPS/eip-7516) is part of
[devnet-9](https://notes.ethereum.org/@ethpandaops/dencun-devnet-9)
2023-09-19 10:45:19 +02:00
racytech
88ddd8caf0
holesky genesis update (#8225) 2023-09-19 04:36:13 +06:00
Andrew Ashikhmin
a6309fe02e
Upgrade execution-spec-tests to Cancun Devnet 9 Release (#8208)
Upgrade execution-spec-tests to
[v1.0.3](https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.3).

Set BeaconRootsAddress to `0xbEac00dDB15f3B6d645C48263dC93862413A222D`
in preparation for
[dencun-devnet-9](https://notes.ethereum.org/@ethpandaops/dencun-devnet-9).
2023-09-18 08:45:52 +02:00
racytech
fa4cf492d4
Revert "remove extra data from holesky genesis (#8207)" (#8217)
This reverts commit 438dd6bdb1. Broke CI.
Reverted. Will make another PR.
2023-09-16 20:54:53 +06:00
racytech
438dd6bdb1
remove extra data from holesky genesis (#8207) 2023-09-15 22:00:56 +06:00
Alex Sharov
abff510ea7
evm: stack.dup() optimize (#8178) 2023-09-12 13:18:23 +07:00
Giulio rebuffo
346b278a3b
Caplin: Improved logging (#8169) 2023-09-10 22:10:21 +02:00
alex.sharov
fd242ae8dd fix truncate blocks logs 2023-09-09 17:32:45 +07:00
Alex Sharov
d60940d7db
Avoid leaking more popped items (#8145) 2023-09-06 15:47:06 +07:00
Mark Holt
8ea0096d56
moved metrics sub packages types to metrics (#8119)
This is a non functional change which consolidates the various packages
under metrics into the top level package now that the dead code is
removed.

It is a precursor to the removal of Victoria metrics after which all
erigon metrics code will be contained in this single package.
2023-09-03 08:09:27 +07:00
Mark Holt
a4cfbe0d56
Heimdall metrics + Metrics HTTP server rationalization (#8094)
This is an update of:

https://github.com/ledgerwatch/erigon/pull/7846

which uses a local fork of victoria metrics to include the changes that
https://github.com/anshalshukla added to the original for we where
using.

It also includes code to address the duplicate metrics issue identified
here:

https://github.com/ledgerwatch/erigon/issues/8053

It has one more associated fix which is to correctly add a metadata
label to counters, these where previously labelled as gauges.

e.g. 

```
# TYPE p2p_peers counter
p2p_peers 0
```
rather than

```
# TYPE p2p_peers gauge
p2p_peers 0
```

---------

Co-authored-by: Anshal Shukla <53994948+anshalshukla@users.noreply.github.com>
Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
2023-08-31 09:04:27 +01:00
Andrew Ashikhmin
9b63764b16
Move ApplyDAOHardFork & UpgradeBuildInSystemContract to engine.Initialize (#8095)
Now all protocol-stipulated changes at the beginning of the block (AuRa
stuff,
[DAO](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/dao-fork.md)
irregular state change, Calcutta system contract upgrade,
[EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) beacon root) are
handled by consensus engine `Initialize()`.
2023-08-30 15:51:19 +02:00
racytech
f477348a50
Support for --chain=holesky (#8064) 2023-08-26 16:31:29 +06:00
Andrew Ashikhmin
a6d9d26fe9
Fix opSelfdestruct6780 (#8066)
also upgrade execution-spec-tests to
[v1.0.2](https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.2)
2023-08-25 08:06:59 +02:00
Andrew Ashikhmin
1fd9d20e14
EIP-4788 v2 (no precompile) (#8038)
See https://github.com/ethereum/EIPs/pull/7456 &
https://github.com/ethereum/go-ethereum/pull/27849. Also set the gas
limit for system calls to 30M (previously 2^64-1), which is in line with
the [Gnosis
spec](https://github.com/gnosischain/specs/blob/master/execution/withdrawals.md#specification),
but should be doubled checked for Gnosis Chain.
2023-08-24 17:10:50 +02:00
Andrew Ashikhmin
64d483e23a
To in EIP-4844 transactions must be non-nil (#8047)
See https://github.com/ethereum/EIPs/pull/7100
2023-08-21 18:00:11 +02:00
Andrew Ashikhmin
6bc0ca9e85
Correctly compute fork id when timestamp fork is activated in genesis (#8046)
See https://github.com/ethereum/go-ethereum/pull/27895
2023-08-21 15:35:13 +02:00
ledgerwatch
6b6c0caad0
Snapshots of Bor events (#7901)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: Alex Sharp <alexsharp@alexs-mbp-2.home>
2023-08-18 17:10:35 +01:00
Andrew Ashikhmin
7947fc8ad1
Always encode EIP-4844 transactions unwrapped (without blobs) (#8012)
The only time we need to serialize blobs/commitments/proofs is when we
reply to `GetPooledTransactions` (and that's handled by the txpool).
2023-08-13 22:32:47 +05:30
jack meng
d370ea7ac2
fixed bitmap performance when write index (#7986)
Here is my case:

writeIndex function takes about 39% in pprof flame graph. I dive into it
and find out that we use POA consensus, therefore mining addresses have
a big bitmap.

```
func writeIndex(blocknum uint64, changes *historyv2.ChangeSet, bucket string, changeDb kv.RwTx) error {
	buf := bytes.NewBuffer(nil)
	for _, change := range changes.Changes {
		k := dbutils.CompositeKeyWithoutIncarnation(change.Key)
		index, err := bitmapdb.Get64(changeDb, bucket, k, math.MaxUint32, math.MaxUint32)
		if err != nil {
			return fmt.Errorf("find chunk failed: %w", err)
		}
		index.Add(blocknum)
		if err = bitmapdb.WalkChunkWithKeys64(k, index, bitmapdb.ChunkLimit, func(chunkKey []byte, chunk *roaring64.Bitmap) error {
			buf.Reset()
			if _, err = chunk.WriteTo(buf); err != nil {
				return err
			}
			return changeDb.Put(bucket, chunkKey, common.CopyBytes(buf.Bytes()))
		}); err != nil {
			return err
		}
	}
	return nil
}
```
assume that a mining address has a big bitmap (Cardinality 400000), then
"writeIndex" will split it into 300 small bitmaps according to
”ChunkLimit“ and next time "writeIndex" will union all small bitmaps
into a big bitmap, then use binary search to split it into 300 small
bitmaps. over and over again.

I think blockNum > index.Maximum(), so that we only need get the last
one of 300 small bitmaps .

Co-authored-by: mengweifu <75886642@qq.com>
2023-08-13 02:07:43 +06:00
Andrew Ashikhmin
e377cea51d
Fix CopyTxs for BlobTxWrapper (EIP-4844) (#8002) 2023-08-11 20:30:02 +02:00
Andrew Ashikhmin
03927d3e27
Call InitializeBlockExecution in SpawnMiningExecStage (EIP-4788) (#7999)
This fixes the trie state root issue that was occurring in the Hive
tests for Cancun.
2023-08-11 14:04:53 +02:00
Andrew Ashikhmin
9b3f3bd118
EIP-4844: fix wiring of maxFeePerBlobGas (#7981)
Previously maxFeePerBlobGas was lost in the `BlobTx` -> `Message`
conversion.

Also added initial support of [EL
EIPTests](https://github.com/ethereum/tests/tree/develop/EIPTests).
2023-08-08 17:44:02 +02:00
Andrew Ashikhmin
ae76df1b8a
Update execution-spec-tests to v1.0.1 (#7980)
[v1.0.1](https://github.com/ethereum/execution-spec-tests/releases/tag/v1.0.1)
"Cancun Devnet-8 Pre-Release" adds some tests for Cancun. This PR only
fixes a couple of issues; the majority of the new tests are still
failing and thus are skipped in `TestExecutionSpec`.
2023-08-08 15:01:35 +02:00
Andrew Ashikhmin
a25f22a06c
Implement EIP-6780: SELFDESTRUCT only in same transaction (#7976)
Cherry pick https://github.com/ethereum/go-ethereum/pull/27189

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2023-08-06 17:48:11 +02:00
Andrew Ashikhmin
d69b20bc4e
Support engine_forkchoiceUpdatedV3 with ParentBeaconBlockRoot (EIP-4788) (#7969)
Prerequisites: https://github.com/ledgerwatch/interfaces/pull/187 &
https://github.com/ledgerwatch/erigon-lib/pull/1069. Also implement
https://github.com/ethereum/execution-apis/pull/426.
2023-08-06 11:54:14 +02:00
Giulio rebuffo
0e4e36b142
Replaced old version of Engine API with newer version (#7972) 2023-08-05 23:33:10 +02:00
Andrew Ashikhmin
d014da4dc0
Replace --override.shanghaiTime flag with --override.cancun (#7964)
Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/1067
2023-08-03 16:05:35 +02:00
racytech
2c2ccb6e27
dencun-devnet: --trusted-setup-file flag support (#7963) 2023-08-03 14:36:47 +02:00
Somnath Banerjee
5ddf122a19
Zero ParentBeaconBlockRoot in genesis (#7958)
See https://github.com/ethereum/EIPs/pull/7445
2023-08-02 17:02:01 +05:30
Somnath Banerjee
d91f4263dc
EIP-4788: Beacon block root and stateful precompile (#7888) 2023-08-01 16:01:26 +05:30
Giulio rebuffo
1220ae659e
Most hive tests fixed in --experimental.modular (#7950)
Broken: 25/109
2023-08-01 02:08:15 +02:00
Andrew Ashikhmin
03ac80ad2d
EIP-4844: rename "data hash" to "blob hash" (#7947)
See https://github.com/ethereum/EIPs/pull/7001
2023-07-31 10:12:53 +02:00
Andrew Ashikhmin
1776d28bb7
Fix TestBlobTxWrappedEncodeDecode (#7944)
Post-fix to PR #7943
2023-07-30 15:56:26 +02:00
racytech
af884204cb
eip-4844: hive tests: RLP decode order and newPayloadV3 to expect versionedHashes (#7943) 2023-07-30 15:49:31 +02:00
Andrew Ashikhmin
27125b3911
Update EIP-2537 and EIP-4844 precompile addresses (#7940)
See https://github.com/ethereum/EIPs/pull/7172 &
https://github.com/ethereum/EIPs/pull/7214
2023-07-28 17:43:01 +02:00
Andrew Ashikhmin
7d35c6b737
EIP-4844: Rename "data gas" to "blob gas" (#7937)
See https://github.com/ethereum/EIPs/pull/7354 &
https://github.com/ethereum/consensus-specs/pull/3461. Prerequisite:
https://github.com/ledgerwatch/erigon-lib/pull/1058
2023-07-28 12:12:05 +02:00
Mark Holt
529d359ca6
Bor span testing (#7897)
An update to the devnet to introduce a local heimdall to facilitate
multiple validators without the need for an external process, and hence
validator registration/staking etc.

In this initial release only span generation is supported.  

It has the following changes:

* Introduction of a local grpc heimdall interface
* Allocation of accounts via a devnet account generator ()
* Introduction on 'Services' for the network config

"--chain bor-devnet --bor.localheimdall" will run a 2 validator network
with a local service
"--chain bor-devnet --bor.withoutheimdall" will sun a single validator
with no heimdall service as before

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-07-18 09:47:04 +01:00
ledgerwatch
035a6f867c
Simplifications for bor tx code (#7889)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-07-14 08:49:10 +01:00
Andrew Ashikhmin
ec5ac3a536
core/vm: implement EIP-5656, mcopy instruction (#7887)
Cherry pick https://github.com/ethereum/go-ethereum/pull/26181

Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
2023-07-13 19:36:06 +02:00
Giulio rebuffo
b2442a7b41
Removed unused stages (Cumulative index + Translation) (#7884) 2023-07-13 16:55:48 +02:00
Andrew Ashikhmin
9702f7f36c
core/vm: move TSTORE,TLOAD to correct opcode nums (#7885)
See https://github.com/ethereum/EIPs/pull/7074. Also enable
[EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) in
[Cancun](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md).

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-07-13 16:40:17 +02:00