go-ethereum/eth/filters
Felix Lange bc42e88415
core: add basic chain history support in GenerateChain (#28428)
This change improves GenerateChain to support internal chain history access (ChainReader)
for the consensus engine and EVM.

GenerateChain takes a `parent` block and the number of blocks to create. With my changes,
the consensus engine and EVM can now access blocks from `parent` up to the block currently
being generated. This is required to make the BLOCKHASH instruction work, and also needed
to create real clique chains.  Clique uses chain history to figure out if the current signer is in-turn,
for example.

I've also added some more accessors to BlockGen. These are helpful when creating transactions:

- g.Signer returns a signer instance for the current block
- g.Difficulty returns the current block difficulty
- g.Gas returns the remaining gas amount

Another fix in this commit concerns the receipts returned by GenerateChain. The receipts now
have properly derived fields (BlockHash, etc.) and should generally match what would be
returned by the RPC API.
2023-10-31 12:39:25 +01:00
..
api.go eth,consensus: replace noarg fmt.Errorf with errors.New (#27330) 2023-05-25 02:57:34 -04:00
api_test.go rpc: change BlockNumber constant values to match ethclient (#27219) 2023-05-23 13:18:38 +02:00
bench_test.go eth/filters: add global block logs cache (#25459) 2022-08-19 11:14:59 +02:00
filter.go eth/filters, core/rawdb: remove unused param, refactor filtering-loop (#27891) 2023-08-10 06:49:05 -04:00
filter_system.go eth/filters: reuse handleLogs method for removed logs (#27438) 2023-06-08 11:40:22 +02:00
filter_system_test.go eth/filters: fix flaky test TestPendingTxFilterDeadlock (#28376) 2023-10-19 10:30:55 +02:00
filter_test.go core: add basic chain history support in GenerateChain (#28428) 2023-10-31 12:39:25 +01:00