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

Simplify the chain_head.rs module #409

Merged
merged 17 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions light-base/src/json_rpc_service/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ use core::{
time::Duration,
};
use futures::{lock::Mutex, prelude::*};
use hashbrown::HashMap;
use smoldot::{
chain::fork_tree,
executor::{host, runtime_host},
header,
json_rpc::{self, methods, requests_subscriptions},
Expand Down Expand Up @@ -101,16 +99,6 @@ struct Background<TPlat: Platform> {
printed_legacy_json_rpc_warning: atomic::AtomicBool,
}

struct FollowSubscription {
/// Tree of hashes of all the current non-finalized blocks. This includes unpinned blocks.
non_finalized_blocks: fork_tree::ForkTree<[u8; 32]>,

/// For each pinned block hash, the SCALE-encoded header of the block.
pinned_blocks_headers: HashMap<[u8; 32], Vec<u8>, fnv::FnvBuildHasher>,

runtime_subscribe_all: Option<runtime_service::SubscriptionId>,
}

pub(super) enum SubscriptionMessage {
StopIfAllHeads {
stop_request_id: (String, requests_subscriptions::RequestId),
Expand Down
Loading