artemis icon indicating copy to clipboard operation
artemis copied to clipboard

Added some more data fields for block collector

Open mw2000 opened this issue 1 year ago • 4 comments

A PR for adding more data fields into the block creator. I think it would be beneficial if we had the base_fee_per_gas, the total gas, timestamp, and the extra_data of the block being collected.

Open question: I've set the base fee to be 0 for blocks previous to London. Maybe there's a cleaner way to do this.

P.S.: I'm new to rust and the library, so I wanted to draft a small PR as I learn and explore Artemis further.

mw2000 avatar Jun 07 '23 04:06 mw2000

If we are adding more data fields, is returning the whole block as ethers::types::Block<TxHash> an overkill?

pistomat avatar Jun 07 '23 15:06 pistomat

Agree with @pistomat, let's make this a Collector<ethers::types::Block<TxHash>> instead of Collector<NewBlock> to avoid having to do manual destructuring

FrankieIsLost avatar Jun 07 '23 21:06 FrankieIsLost

Okay, added block as a subitem of NewBlock. block is of type Block<TxHash> and modified some stuff that would change due to this.

mw2000 avatar Jun 08 '23 09:06 mw2000

@FrankieIsLost was revisiting some old PRs, is this still merge-worthy or close?

mw2000 avatar Apr 12 '24 04:04 mw2000