Skip to content

Commit

Permalink
feat: Make fc-rpc dependencies on aura crates optional (polkadot-evm#…
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d authored Dec 27, 2024
1 parent 11f8340 commit 105bc38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
17 changes: 11 additions & 6 deletions client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ rand = "0.8"
rlp = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
schnellru = "0.2.3"
serde = { workspace = true }
serde = { workspace = true, optional = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["sync"] }

# Substrate
prometheus-endpoint = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus-aura = { workspace = true }
sc-consensus-aura = { workspace = true, optional = true }
sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-rpc = { workspace = true }
Expand All @@ -43,15 +43,15 @@ sp-api = { workspace = true, features = ["default"] }
sp-block-builder = { workspace = true, features = ["default"] }
sp-blockchain = { workspace = true }
sp-consensus = { workspace = true }
sp-consensus-aura = { workspace = true, features = ["default"] }
sp-consensus-aura = { workspace = true, features = ["default"], optional = true }
sp-core = { workspace = true, features = ["default"] }
sp-externalities = { workspace = true, features = ["default"] }
sp-inherents = { workspace = true, features = ["default"] }
sp-io = { workspace = true, features = ["default"] }
sp-runtime = { workspace = true, features = ["default"] }
sp-state-machine = { workspace = true, features = ["default"] }
sp-storage = { workspace = true, features = ["default"] }
sp-timestamp = { workspace = true, features = ["default"] }
sp-timestamp = { workspace = true, features = ["default"], optional = true }
# Frontier
fc-api = { workspace = true }
fc-mapping-sync = { workspace = true }
Expand All @@ -73,11 +73,16 @@ substrate-test-runtime-client = { workspace = true }
fc-db = { workspace = true }

[features]
default = ["rocksdb"]
default = ["aura", "rocksdb"]
aura = [
"sc-consensus-aura",
"sp-consensus-aura",
"sp-timestamp",
]
rocksdb = [
"sc-service/rocksdb",
"fc-db/rocksdb",
"fc-mapping-sync/rocksdb",
]
txpool = ["fc-rpc-core/txpool"]
txpool = ["fc-rpc-core/txpool", "serde"]
rpc-binary-search-estimate = []
16 changes: 8 additions & 8 deletions client/rpc/src/eth/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,19 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use std::{marker::PhantomData, sync::Arc};

// Substrate
use sc_client_api::{
backend::{AuxStore, Backend, StorageProvider},
UsageProvider,
};
use sc_client_api::backend::{Backend, StorageProvider};
use sc_transaction_pool::ChainApi;
use sc_transaction_pool_api::InPoolTransaction;
use sp_api::{ApiExt, ApiRef, Core, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_blockchain::{ApplyExtrinsicFailed, HeaderBackend};
use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider};
use sp_runtime::{
generic::{Digest, DigestItem},
generic::Digest,
traits::{Block as BlockT, Header as HeaderT, One},
TransactionOutcome,
};
use sp_timestamp::TimestampInherentData;

use crate::eth::Eth;
use fp_rpc::EthereumRuntimeRPCApi;
Expand Down Expand Up @@ -169,14 +163,20 @@ impl<B: BlockT> ConsensusDataProvider<B> for () {
}
}

#[cfg(feature = "aura")]
pub use self::aura::AuraConsensusDataProvider;
#[cfg(feature = "aura")]
mod aura {
use super::*;
use sc_client_api::{AuxStore, UsageProvider};
use sp_consensus_aura::{
digests::CompatibleDigestItem,
sr25519::{AuthorityId, AuthoritySignature},
AuraApi, Slot, SlotDuration,
};
use sp_runtime::generic::DigestItem;
use sp_timestamp::TimestampInherentData;
use std::{marker::PhantomData, sync::Arc};

/// Consensus data provider for Aura.
pub struct AuraConsensusDataProvider<B, C> {
Expand Down

0 comments on commit 105bc38

Please sign in to comment.