paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.99k stars 1.21k forks source link

fix: add senders in cache if not present #12712

Closed alessandromazza98 closed 1 day ago

alessandromazza98 commented 1 day ago

Closes https://github.com/paradigmxyz/reth/issues/12659

Supersedes https://github.com/paradigmxyz/reth/pull/12666

Basically what happens to me is that if I use the new engine, when blocks get saved in the cache, senders is empty even though there is a transaction in the block. In fact, senders is empty only in the cache, while in the db senders is already populated correctly.

@joshieDo @mattsse what do you think of this solution?

mattsse commented 1 day ago

hmm, I'd like to understand first why this happens

alessandromazza98 commented 1 day ago

hmm, I'd like to understand first why this happens

can I look for something specifically in the logs? I added a bunch of print statements to see what was happening and I was doing the following:

then, i do a curl (or using cast) request using eth_getBlockByHash and if i request the full block i get no transactions, if i request only tx hashes i see the one tx hash.

alessandromazza98 commented 1 day ago

from the print statements I was able to see that when the block is built and a BlockWithSenders is built, the sender is correct (like 0xdeaddeaddead...), but I don't know why in the cache the block is passed with empty senders

alessandromazza98 commented 1 day ago

wait, probably I found the problem and was not related to reth but to how I modified the payload building function, will let you know

alessandromazza98 commented 1 day ago

ok problem solved, I was not including senders in the payload building function, will close the pr and the issue, thanks.