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

chore(deps): Update smoldot to the latest version #1400

Merged
merged 38 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bf3c7f3
Update smoldot to 0.17 and smoldot-light to 0.15
lexnv Jan 26, 2024
1231920
Update cargo lock
lexnv Jan 26, 2024
ab0f67f
lightclient: Add generic platform for AddedChain
lexnv Jan 26, 2024
b948044
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Jan 30, 2024
f14bf9a
debug: Finalized heads
lexnv Jan 30, 2024
644626f
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Apr 3, 2024
b91742a
lightclient: Use generic TPlat for chainSuccess
lexnv Apr 3, 2024
75ace42
lightclient: Trim response for logs
lexnv Apr 3, 2024
c8020c9
Backup
lexnv Apr 8, 2024
6c9088e
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Apr 9, 2024
74dd9d7
tests/lightclient: Switch to localnode for testing
lexnv Apr 9, 2024
1c96d5e
cargo: Point smoldot to crates.io
lexnv Apr 9, 2024
03c629a
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Apr 9, 2024
1de5a06
Solve merge conflicts
lexnv Apr 9, 2024
c74e4ad
Add subxt macro for tests
lexnv Apr 9, 2024
b517adf
lightclient/wasm: Impl log of the PlatformRef
lexnv Apr 9, 2024
67ca3ec
Use git dep
lexnv Apr 15, 2024
c776229
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Jun 25, 2024
c4fe110
Revert "tests/lightclient: Switch to localnode for testing" + max log
lexnv Jun 25, 2024
6cca6f9
tests: Comment chainspec
lexnv Jun 25, 2024
2e7bacd
lightclient/wasm: Import IpAddr from core::net
lexnv Jun 26, 2024
c587309
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Jun 26, 2024
a6d7055
tests: Enable all tests again
lexnv Jun 26, 2024
3412cb6
tests/wasm: Update cargo lock
lexnv Jun 26, 2024
b6bdd06
tests: Add trace logs to easily reproduce problems
lexnv Jun 26, 2024
2779faf
cargo: Use released smoldot version
lexnv Jun 26, 2024
4612da3
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Sep 3, 2024
648b4f9
lightclient: Use chainspec and optionally make use of unstable backend
lexnv Sep 3, 2024
3b81de0
lightclient: Fix clippy
lexnv Sep 3, 2024
b69cba7
lightclient: Better trimming for log messages
lexnv Sep 6, 2024
f222db1
lightclient: Remove max log size
lexnv Sep 6, 2024
1a02662
lightclient: Use both backends for testing
lexnv Sep 6, 2024
f3c6179
Update Cargo.toml
lexnv Sep 6, 2024
8b34dcd
Update Cargo.toml
lexnv Sep 6, 2024
30c81b8
Merge remote-tracking branch 'origin/master' into lexnv/update-smoldot
lexnv Sep 6, 2024
7a41bf7
Merge branch 'master' into lexnv/update-smoldot
niklasad1 Sep 6, 2024
0b611f5
Update testing/integration-tests/src/light_client/mod.rs
niklasad1 Sep 6, 2024
43bd4db
Update testing/integration-tests/src/light_client/mod.rs
niklasad1 Sep 6, 2024
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
36 changes: 28 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ scale-typegen = "0.1.1"
strip-ansi-escapes = "0.2.0"

# Light client support:
smoldot = { version = "0.16.0", default-features = false }
smoldot-light = { version = "0.14.0", default-features = false }
smoldot = { version = "0.17.0", default-features = false }
smoldot-light = { version = "0.15.0", default-features = false }
tokio-stream = "0.1.14"
futures-util = "0.3.30"
rand = "0.8.5"
Expand Down
4 changes: 2 additions & 2 deletions lightclient/src/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ impl<TPlatform: PlatformRef, TChain> BackgroundTask<TPlatform, TChain> {
/// Perform the main background task:
/// - receiving requests from subxt RPC method / subscriptions
/// - provides the results from the light client back to users.
pub async fn start_task(
pub async fn start_task<TPlat: smoldot_light::platform::PlatformRef>(
&mut self,
from_subxt: mpsc::UnboundedReceiver<FromSubxt>,
from_node: Vec<AddedChain>,
from_node: Vec<AddedChain<TPlat>>,
) {
let from_subxt_event = tokio_stream::wrappers::UnboundedReceiverStream::new(from_subxt);

Expand Down
6 changes: 3 additions & 3 deletions lightclient/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl LightClientRpc {
/// https://docs.rs/wasm-bindgen-futures/latest/wasm_bindgen_futures/fn.future_to_promise.html.
pub fn new_from_client<TPlat>(
client: smoldot_light::Client<TPlat>,
chains: impl IntoIterator<Item = AddedChain>,
chains: impl IntoIterator<Item = AddedChain<TPlat>>,
) -> RawLightClientRpc
where
TPlat: smoldot_light::platform::PlatformRef + Clone,
Expand Down Expand Up @@ -202,9 +202,9 @@ impl LightClientRpc {
}

/// The added chain of the light-client.
pub struct AddedChain {
pub struct AddedChain<TPlat: smoldot_light::platform::PlatformRef> {
/// The id of the chain.
pub chain_id: smoldot_light::ChainId,
/// Producer of RPC responses for the chain.
pub rpc_responses: smoldot_light::JsonRpcResponses,
pub rpc_responses: smoldot_light::JsonRpcResponses<TPlat>,
}
17 changes: 7 additions & 10 deletions subxt/src/client/light_client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,27 +186,27 @@ impl<T: Config> LightClientBuilder<T> {
}

/// Raw builder for [`RawLightClient`].
pub struct RawLightClientBuilder {
chains: Vec<AddedChain>,
pub struct RawLightClientBuilder<TPlatform: smoldot::PlatformRef> {
chains: Vec<AddedChain<TPlatform>>,
}

impl Default for RawLightClientBuilder {
impl<TPlatform: smoldot::PlatformRef> Default for RawLightClientBuilder<TPlatform> {
fn default() -> Self {
Self { chains: Vec::new() }
}
}

impl RawLightClientBuilder {
impl<TPlatform: smoldot::PlatformRef> RawLightClientBuilder<TPlatform> {
/// Create a new [`RawLightClientBuilder`].
pub fn new() -> RawLightClientBuilder {
pub fn new() -> RawLightClientBuilder<TPlatform> {
RawLightClientBuilder::default()
}

/// Adds a new chain to the list of chains synchronized by the light client.
pub fn add_chain(
mut self,
chain_id: smoldot::ChainId,
rpc_responses: smoldot::JsonRpcResponses,
rpc_responses: smoldot::JsonRpcResponses<TPlatform>,
) -> Self {
self.chains.push(AddedChain {
chain_id,
Expand All @@ -219,10 +219,7 @@ impl RawLightClientBuilder {
///
/// The provided `chain_id` is the chain with which the current instance of light client will interact.
/// To target a different chain call the [`LightClient::target_chain`] method.
pub async fn build<TPlatform: smoldot::PlatformRef>(
self,
client: smoldot::Client<TPlatform>,
) -> Result<RawLightClient, Error> {
pub async fn build(self, client: smoldot::Client<TPlatform>) -> Result<RawLightClient, Error> {
// The raw subxt light client that spawns the smoldot background task.
let raw_rpc: subxt_lightclient::RawLightClientRpc =
subxt_lightclient::LightClientRpc::new_from_client(client, self.chains.into_iter());
Expand Down
2 changes: 1 addition & 1 deletion subxt/src/client/light_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl RawLightClient {
/// # Note
///
/// If you are unsure, please use [`LightClient::builder`] instead.
pub fn builder() -> RawLightClientBuilder {
pub fn builder<TPlatform: smoldot::PlatformRef>() -> RawLightClientBuilder<TPlatform> {
RawLightClientBuilder::default()
}

Expand Down
Loading