This PR adds a new witness stage to generate and store witness while processing blocks. Due to certain restrictions, it generates the witness of the previous block while processing the current one.
Checklist before merging
[x] Add witness stage to generate and store witness for previous block
[x] Read/Write witness
[x] Put witness generation behind a flag
[x] Refactor code to handle different operations and improve code readability
[x] Store only last n witness (configurable)
[x] Consume stored witness in eth_getWitness endpoint
[x] Merge upstream (feat/zero)
[x] Resolve issues faced while testing (eth_getWitness doesn't work under some cases, need to debug it)
Future optimisations
[ ] Generate witness for the same block while processing (this removes the need to rewind the stages)
[ ] Modify the execution stage to also include witness generation
This PR adds a new witness stage to generate and store witness while processing blocks. Due to certain restrictions, it generates the witness of the previous block while processing the current one.
Checklist before merging
eth_getWitness
endpointfeat/zero
)eth_getWitness
doesn't work under some cases, need to debug it)Future optimisations