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

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Jan 26, 2024

This PR updates smoldot to 0.17 and smoldot-light to 0.15.

Changes to repo:

  • AddedChain now receives a generic PlatformRef trait to accommodate smoldot changes

Pending fix from:

Status Update 8 July

  • Smoldot is now producing blocks with the legacy RPCS
  • The latest version has a regression in syncing from 30seconds to 175seconds
  • This means we are producing blocks, but the distance between the first finalized block (the block presented in the chainSpec) and the second finalized block is now 175seconds (until grandpa warp sync completes)

Pending fix:

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv requested a review from a team as a code owner January 26, 2024 13:09
Comment on lines 178 to 183
// non_finalized_headers_subscription(&api).await?;
finalized_headers_subscription(&api).await?;
runtime_api_call(&api).await?;
storage_plain_lookup(&api).await?;
dynamic_constant_query(&api).await?;
dynamic_events(&api).await?;
// runtime_api_call(&api).await?;
// storage_plain_lookup(&api).await?;
// dynamic_constant_query(&api).await?;
// dynamic_events(&api).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these still be commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I've added a few debug logs in f14bf9a.
This is to help reproduce the issue from smoldot faster smol-dot/smoldot#1638.

I suggest putting this PR on pending until another smoldot version is published on crates io :D

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds like a plan :)

@niklasad1 niklasad1 self-requested a review January 31, 2024 09:26
@lexnv lexnv changed the title chore(deps): Update smoldot to the latest version [pending fix] chore(deps): Update smoldot to the latest version Jan 31, 2024
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
lexnv added 14 commits April 8, 2024 10:56
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
size

This reverts commit 74dd9d7.

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv changed the title [pending fix] chore(deps): Update smoldot to the latest version chore(deps): Update smoldot to the latest version Jun 26, 2024
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
fn trim_response(response: &str) -> &str {
const MAX_RESPONSE_SIZE: usize = 256;
let len = std::cmp::min(response.len(), MAX_RESPONSE_SIZE);
&response[..len]
Copy link
Member

Choose a reason for hiding this comment

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

nit, you could actually index into non-char boundary here because not all chars are ascii which leads to a panic..

https://github.com/paritytech/jsonrpsee/blob/master/core/src/tracing.rs#L101-#L124

Copy link
Collaborator

@jsdw jsdw Sep 4, 2024

Choose a reason for hiding this comment

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

There are a couple of nightly only methods that would be perfect here, but in the absense of them one could do:

while !response.is_char_boundary(len) {
    len -= 1;
}
&response[..len]

To find the appropriate place to slice a message that exceeds the length

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've ended up with something similar to Niklas's suggestion, I found that a bit easier to follow :D

@niklasad1 niklasad1 self-requested a review September 4, 2024 07:41
Comment on lines 180 to 184
let (maybe_truncated, delim) = if back_message.len() > MAX_LOG_SIZE {
(&back_message[0..MAX_LOG_SIZE], "...")
} else {
(&back_message[..], "")
};
Copy link
Collaborator

@jsdw jsdw Sep 4, 2024

Choose a reason for hiding this comment

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

Do we need to worry about invalid UTF boundaries here too?

(should trim_repsonse take in a max length and then it can be used here too?)

Comment on lines 40 to 41
/// Use the unstable backend for testing.
const USE_UNSTABLE_BACKEND: bool = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess it makes sense to test the light client with just the "unstable" backend, though we could have that light client test be a fn that takes in this bool and then run it twice to test both backends until the unstable one is stabilised? (and then remove this const)

Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

Couple of small nits but looks great to me; thanks for doing this!

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

🚀

lexnv and others added 5 commits September 6, 2024 13:39
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
@lexnv lexnv merged commit 1cf206f into master Sep 9, 2024
13 checks passed
@lexnv lexnv deleted the lexnv/update-smoldot branch September 9, 2024 07:30
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.

3 participants