Skip to content

Conversation

@debjit-bw
Copy link
Member

we are reaching git lfs limits with a small number of downloads, this fixes the problem by enabling unlimited downloads from r2 and ditching git lfs (along with the complexity it came with).

the files are still canonical with the git repo ones so everyone can check the served files.

@debjit-bw
Copy link
Member Author

info: file combination (chunks) are no longer there as the 4 GiB file limit is an LFS thing, so we can directly host the combined compressed state file on R2 instead of having to combine the chunks ourselves.

Copy link
Member

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

Nice, better hosting solution. But you need to check integrity

)];

fn get_chunks(chain: &str) -> Vec<(&'static str, u64)> {
const R2_BASE: &str = "https://initstate.gnosischain.com";
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this a CLI arg that defaults to this value? Ok to do in another PR

Copy link
Member Author

Choose a reason for hiding this comment

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

created an issue for later

Copy link
Member Author

Choose a reason for hiding this comment

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

#96

fn get_compressed_state_size(chain: &str) -> u64 {
match chain {
"gnosis" => 5_672_943_444,
"chiado" => 22_468_068,
Copy link
Member

Choose a reason for hiding this comment

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

You should hardcode the file hash and check integrity after downloading. Much better to check local file is fine that just the size.

Copy link
Member

Choose a reason for hiding this comment

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

The trust assumption otherwise it's very sketchy: hey download a random file from our URL that you can't change and hope it's fine. Even if no-one uses it you should add a hackmd somewhere with steps to recreate those files and serve them in an independent route

Copy link
Member Author

Choose a reason for hiding this comment

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

made hash verification for the downloaded files, and added a markdown for recreating the state files

println!("✅ compressed state verified");
} else {
println!("✅ compressed state already present");
println!("✅ compressed state verified");
Copy link
Member

Choose a reason for hiding this comment

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

Use tracing to be consistent with the rest of reth logging

Copy link
Member Author

Choose a reason for hiding this comment

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

tracing cannot be used here as this part of the code is before tracing is initialized (at node startup)

@debjit-bw debjit-bw requested a review from dapplion December 1, 2025 20:51
Copy link
Member

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

Great job! Thanks

@debjit-bw debjit-bw merged commit d507975 into master Dec 3, 2025
7 checks passed
@debjit-bw debjit-bw deleted the lfs-to-r2 branch December 3, 2025 12:18
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