Commit Graph

711 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
Alex Sharov
a22ab813af
evm: simplify addToAccessList methods (#8280) 2023-09-25 08:52:51 +07: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
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
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
Giulio rebuffo
0e4e36b142
Replaced old version of Engine API with newer version (#7972) 2023-08-05 23:33:10 +02:00
ledgerwatch
ef4ccd4773
Remove excessive logging (#7882) 2023-07-13 00:52:03 +01:00
Mark Holt
bd9896bf4b
added bor tx indexing with tests (#7826)
This request implements the insertion of Bor ephemeral transactions into
snapshot indexes.

I does this by taking the block hash from the header index and passing
it to the transaction indexer to add an additional index entry per block
into the transaction hash -> block index.

The passed entries are currently contained in an in memory array which
is (32 * number of blocks / sprint size) bytes.

In addition to the functional code there is also an update to the
`dump_test.go` so that it runs `DumpBlocks` to exercise the indexing
code. To facilitate this the `InsertChain` method in `mock_sentry` has
been modified so that it can process >128 blocks.

The code in this request also includes additional bor/consensus code
with the following functions:

`CalculateSprint`
`CalculateSprintCount`

The first function is a modification of the code in erigon-lib so that
the sprints are numerically rather than lexically ordered. This code
should be migrated to erigon-lib and should have its sprint set
calculated once from its underlying map rather than this process being
repeated every calculation.

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
Co-authored-by: ledgerwatch <akhounov@gmail.com>
Co-authored-by: Enrique Jose  Avila Asapche <eavilaasapche@gmail.com>
Co-authored-by: Giulio <giulio.rebuffo@gmail.com>
2023-07-12 23:31:38 +01:00
Alex Sharov
ded166d73d
e3: release chain maker changes (#7787) 2023-06-23 10:07:42 +07:00
Alex Sharov
880c939df8
e3: idx range method (#7767) 2023-06-20 10:58:37 +07:00
awskii
932c2ac69d
fix for test (#7765)
Fixes test `TestExec22/UnwindExecutionStagePlainStatic`.
2023-06-20 02:04:42 +01:00
Somnath Banerjee
71231140a5
Block Gas limit contract integration for Chiado (#7727)
Changes summary:
- Continue with the gasLimit check skip in ``verifyHeader`` of
``merge.go`` for unless pre-merge block and blockGasLimitContract
present
- Refactor ``aura.go`` a bit
- Have ``sysCall`` method customized to be able to call state (contract)
at a parent (or any other) header state
2023-06-19 22:06:51 +05:30
Alex Sharov
2adf258a33
e3: simplify unwind (#7758) 2023-06-19 11:40:13 +07:00
Alex Sharov
d3c3be9c91
e2: optimize tests speed (#7738) 2023-06-15 16:09:11 +07:00
Alex Sharov
5ff8246e2a
e4: release some tests (#7729) 2023-06-14 10:01:00 +07:00
Alex Sharov
afd8ea94d0
e3: move domains to tables.go (#7707) 2023-06-11 21:12:05 +07:00
Alex Sharov
4766cd8aeb
e2: avoid do RestoreCodeHash twice (#7706)
- do it only once in HistoryStateReader
2023-06-11 12:28:47 +07:00
Alex Sharov
3b89ed81d6
e3: erigon_getBalanceChanges (#7704) 2023-06-11 11:49:53 +07:00
Alex Sharov
1546a79771
lru lib version up (#7695) 2023-06-09 13:46:58 +07:00
Alex Sharov
6c129e5f1d
e3: agg generalize PutIdx method (#7671) 2023-06-06 11:29:30 +07:00
Alex Sharov
26f9c064ac
mainnet: more block snapshots (#7662) 2023-06-05 11:25:37 +07:00
Alex Sharov
63c92010cd
remove txsV3 cli flag (#7644) 2023-06-03 15:54:27 +07:00
Alex Sharov
b163d3a877
e3: release some e4 parts (#7629) 2023-06-02 10:55:40 +07:00
Alex Sharov
5fb31ae95f
e3: release some e4 parts (#7628) 2023-06-02 10:35:26 +07:00
Alex Sharov
2278bf5bfc
e3: move kvlist to erigon-lib (#7625) 2023-06-02 09:51:16 +07:00
Alex Sharov
7c89afcb42
e3: add kvlist.push method (#7624) 2023-06-02 09:24:22 +07:00
Alex Sharov
63afe65686
Use BlockReader in ForkValidator, CliqueAPI (#7562) 2023-05-23 14:49:17 +07:00
ledgerwatch
b382f96f6c
Introduce logger into etl (#7537)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-18 21:20:07 +01:00
Alex Sharov
d9abfd826f
e4: rename HistoryReaderV4 (#7461) 2023-05-08 15:44:19 +07:00
Alex Sharov
f28f97acc9
history_reader_v3: must always return accounts encoded as v3 (#7460) 2023-05-08 15:30:15 +07:00
Alex Sharov
231d128d91
e3: parallel exec docs (#7459) 2023-05-08 14:32:12 +07:00
ledgerwatch
fdd385cef1
[Devnet tool] Side-quest to improve logging - part 1 (#7445)
This is the beginning of the series of changes to make it possible to
run multiple instances of erigon inside a single process (as devnet tool
does), with the logging from these processes going to respective log
files correctly.
This is the first part where the initial infrastructure is being
established

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-05-07 07:28:15 +01:00
Alex Sharov
268674cdde
e4: tests compat (#7436) 2023-05-04 11:30:21 +07:00
Andrew Ashikhmin
1533674dad
Implement EIP-1153 transient storage (#7405)
Port https://github.com/ethereum/go-ethereum/pull/26003

---------

Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
2023-05-01 18:26:24 +02:00
Alex Sharov
419cab55ba
e3: dont fetch code hash in unwind (#7416) 2023-05-01 10:16:59 +07:00
Alex Sharov
4344136973
e3: rethink meaning of kv_temporal.BeginRw() (#7413) 2023-04-30 10:08:41 +07:00
ledgerwatch
9b5b24a0b3
Fix lint (#7399)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-04-27 13:39:27 +01:00
Alex Sharov
ded8283df7
erigon backup: v0 of sub-command (#7396) 2023-04-27 10:42:12 +07:00
Alex Sharov
367f3e9afa
e3: log slow (unclosed) contexts to detect leaks (#7375) 2023-04-24 12:52:15 +07:00
Alex Sharov
c39cc6a441
Test squash (#7346) 2023-04-19 15:42:37 +07:00
alex.sharov
688f3838b8 fix import cycle in tests 2023-04-19 15:41:12 +07:00
alex.sharov
0b778b9422 fix import cycle in tests 2023-04-19 15:39:45 +07:00
alex.sharov
61deabc561 e4: assert state reader 2023-04-19 10:12:16 +07:00
Alex Sharov
21d66d6c01
e3: state reader constructor in tests (#7338) 2023-04-19 03:10:33 +00:00
Andrew Ashikhmin
02f6cac7b7
Move hexutil.Bytes to erigon-lib (#7305) 2023-04-13 11:19:02 +00:00
alex.sharov
6e57f3ef92 e3: less conlicts 2023-04-10 09:38:08 +07:00
Alex Sharov
e26c607922
e3: combine input tasks channel+heap to class PriorityQueueWithRetry and add docs (#7275) 2023-04-07 06:43:05 +00:00
Alex Sharov
9b5d7357dd
e3: remove sync.Cond and make ownership of first queue clearer (producer will close it). (#7268)
Separate: 
- new tasks coming by channel with limited capacity (touching the limit
will block - like sync.Cond.Wait() does, but composable). as a result -
don't need track queue size (it will not increase conflict-rate).
- re-exec tasks are going to priority-queue (which is also higher
priority than 1-st `chan`).
2023-04-06 09:03:54 +00:00
Alex Sharov
65fcec8d85
e3: replace sync.Cond to fix deadlock (#7243) 2023-04-03 11:33:43 +00:00
Alex Sharov
8720641c3a
e3: register metric the right way (#7244) 2023-04-03 08:55:10 +00:00