paradigmxyz / reth

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

std: fix `std::thread_local` dep for no-std config #10871

Open tcoratger opened 2 months ago

tcoratger commented 2 months ago

Describe the feature

At the moment, we are using std::thread_local

https://github.com/paradigmxyz/reth/blob/817b1527e9daf30e838e14b49171db86be266219/crates/primitives/src/compression/mod.rs#L1

but unfortunately, the thread_local is not available for no-std config so that to unify stuffs, we need to find an alternative that works both for std and no-std configurations.

Related https://github.com/paradigmxyz/reth/pull/10861#discussion_r1756903379

Additional context

No response

nadtech-hub commented 1 month ago

Another suggestion is to write a few fns instantiating RefCell<_>. Compressor/Drcompressor can be also instantiated in place it is used

nadtech-hub commented 1 month ago

I was also looking to introduce RTIC to mimic LTS behavior. Would you mind it?

nadtech-hub commented 1 month ago

I created PR a couple of days ago. Can this issue be assigned to me?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 21 days with no activity.

nadtech-hub commented 1 month ago

The or was merged a while ago. Can this be marked as resolved?