erigon-pulse/eth
Mark Holt f2d0118a33
Bor snapshot block production (#8065)
I have added:

```go
{
	ID:          stages.BorHeimdall,
	Description: "Download Bor-specific data from Heimdall",
	Forward: func(firstCycle bool, badBlockUnwind bool, s *StageState, u Unwinder, tx kv.RwTx, logger log.Logger) error {
		if badBlockUnwind {
			return nil
		}
		return BorHeimdallForward(s, u, ctx, tx, borHeimdallCfg, true, logger)
	},
	Unwind: func(firstCycle bool, u *UnwindState, s *StageState, tx kv.RwTx, logger log.Logger) error {
		return BorHeimdallUnwind(u, ctx, s, tx, borHeimdallCfg)
	},
	Prune: func(firstCycle bool, p *PruneState, tx kv.RwTx, logger log.Logger) error {
		return BorHeimdallPrune(p, ctx, tx, borHeimdallCfg)
	},
},
```
To MiningStages as well as Default as otherwise bor events are not added
when the block producer creates new blocks.

There are a couple of questions I have around this implementation:

* Is this the right place to add this
* As the state is also executed when the default stage is processed ther
is some duplicate processing for the block producing node.
* There is a duplicated call to heimdall which could be removed if the
stages share state - but its not clear if we want to do this.
* I don't think the mining stage needs to prune as this will be
replicated in the default iteration

This can be tested using the devnet with the following arguments:

```
--chain bor-devnet --bor.localheimdall --scenarios state-sync
```

This will generate sync events via an ethereum devnet which are
transmitted to bor chain and will be executed at the end of the snapshot
delay, which results in events generated from the bor chain. This tests
the whole sync, block generation, event lifecycle. As it needs to wait
for sprints to end after a sufficient delay it is quite slow to run.
2023-08-30 08:06:09 +01:00
..
calltracer Convert *vm.EVM to vm.VMInterface in Tracers (#6590) 2023-01-16 22:28:50 +00:00
ethconfig add flag --force.partial.commit: to workaround problem "start from backup takes long time and can't save partial progress" (#8090) 2023-08-30 08:49:16 +07:00
ethconsensusconfig Snapshots of Bor events (#7901) 2023-08-18 17:10:35 +01:00
ethutils reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
filters Bor eth event flow (#8068) 2023-08-25 12:19:39 +01:00
gasprice Replaced old version of Engine API with newer version (#7972) 2023-08-05 23:33:10 +02:00
integrity go 1.19 atomics (#7164) 2023-03-23 05:11:28 +00:00
protocols/eth fix linter 2023-08-25 12:05:45 +07:00
stagedsync Bor snapshot block production (#8065) 2023-08-30 08:06:09 +01:00
tracers Update execution-spec-tests to v1.0.1 (#7980) 2023-08-08 15:01:35 +02:00
api_backend.go reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
api.go Embed rpcdaemon: prepared direct clients (#3492) 2022-02-12 19:47:19 +07:00
backend.go Bor snapshot block production (#8065) 2023-08-30 08:06:09 +01:00
bloombits.go remove database field from Ethereum object (#1750) 2021-04-19 14:56:44 +07:00
discovery.go rename (#1978) 2021-05-20 19:25:53 +01:00