Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploration fixing features #7

Closed
wants to merge 10 commits into from
Closed

Conversation

citizen-stig
Copy link
Member

@citizen-stig citizen-stig commented Aug 5, 2024

Description

This PR adds cargo hack to validate that crates `` can compile with all feature combinations.

This check fails on version 1.0.3, so this PR also contains fixes for it.

Main fixes

  • remove thiserror-no-std in favor of original thiserror and feature gate it behind std.
  • zstd is only supported together with std, as it is very hard to get zstd work in no_std
  • c-kzg is only supported together with std, for similar reason as zstd.
  • put all jsonrpsee related types in reth-rpc-types behind default feature flag, so it is possible to compile it for riscv
  • Minor fixes in depedencies feature-gating

pub enum InvalidTransactionError {
/// The sender does not have enough funds to cover the transaction fees
#[error(
#[cfg_attr(feature = "std", error(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we feature gated the entire enum do we have to do it for every case again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I am rebasing on latest main from reth, maybe it won't be needed!

Thank you for flagging

use std::{cell::RefCell, thread_local};
#[cfg(not(feature = "std"))]
use zstd::bulk::Decompressor;
#[cfg(feature = "std")]
use zstd::bulk::{Compressor, Decompressor};
Copy link
Member

@bkolad bkolad Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of feature gating here. Instead of use on top of the file could we just use the full path.
For example instead of:

[cfg(feature = "std")]
 use zstd::bulk::{Compressor, Decompressor};

we could:
zstd::bulk::Compressor in line 26 (the same for other imports)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants