Skip to content

docs: improved docs and logging for migrations from-ipfs#695

Merged
smrz2001 merged 5 commits into
ceramicnetwork:mainfrom
m0ar:m0ar/improve-migration-docs-and-logging
May 26, 2025
Merged

docs: improved docs and logging for migrations from-ipfs#695
smrz2001 merged 5 commits into
ceramicnetwork:mainfrom
m0ar:m0ar/improve-migration-docs-and-logging

Conversation

@m0ar

@m0ar m0ar commented Mar 21, 2025

Copy link
Copy Markdown
Collaborator

Heya 👋

IPFS migration

I did a pass over the docs and logging to make it a bit easier to understand what's going on, after being confused more times than I care to admit with failing block imports (mostly related to incorrect paths in the input_file_list causing silent skips of the entire block set).

Took a swing at explaining some of the new validation options as well, LMK if something is factually incorrect!

RPC URLs config

Additionally, I got bitten by the fact that the --ethereum_rpc_urls flag/var seems to accept multiple endpoints, but in reality ignores everything after the first valid one. That's now made clear in the docs too. A potentially better fix would be to just accept a single one in config, but I chose to play defensively and not risk breaking startup for existing configs.

image
image

@m0ar m0ar requested review from a team and stbrody as code owners March 21, 2025 10:03
@m0ar m0ar requested review from dav1do and removed request for a team March 21, 2025 10:03
Comment thread one/src/migrations.rs Outdated
Comment thread one/src/daemon.rs Outdated
Comment on lines +243 to +244
///
/// Note: only the first valid RPC URL will be used by the time event validator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the code uses the first RPC URL to return a successful result but continues iterating through the rest until it finds one that succeeds, or all of them fail.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but I think this is only run when the TimeEventValidator is constructed, not every time it tries to validate an event, and it returns a hashmap which can only have one entry per key (which is the chain ID).

So what's happening here is that when starting the daemon, it checks if the first RPC URL can respond with it's own chain ID (see HttpEthRpc below). If so, it's set in a hashmap where the chain ID is the key, hence only one provider per chain ID is set in chain_providers.

image

image

Hence, when it's time to validate it just checks if there is a (as in one) provider for that chain ID, and uses it for the check:
image

@m0ar m0ar Mar 21, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh also I did reproduce this behavior when switching to the blastapi RPC Nathaniel recommended. If that RPC URL is first, the node can sync, but if I flip it it fails just like if I only had the Ankr one set. I'd say this matches up with how I read the code above, if there isn't something else going on 👀

image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So we can support multiple RPC endpoints, but like you point out we only use one per chain. That is, if we have time events that were anchored on ethereum mainnet and recall, we'd need two RPC urls so that we can verify time events for both chains. We don't currently support multiple endpoints for a single chain (e.g. to round robin for eth mainnet).

@stbrody

stbrody commented May 21, 2025

Copy link
Copy Markdown
Collaborator

@smrz2001 what's the status of this PR? Can this be closed?

@smrz2001

Copy link
Copy Markdown
Contributor

@smrz2001 what's the status of this PR? Can this be closed?

Let me discuss this with @m0ar.

Comment thread one/src/daemon.rs Outdated
Co-authored-by: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com>
@m0ar

m0ar commented May 26, 2025

Copy link
Copy Markdown
Collaborator Author

@stbrody @smrz2001 Hey guys, sorry for snoozing on this. I've applied the suggestions :)

@smrz2001 smrz2001 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@smrz2001 smrz2001 changed the title Improved docs and logging for migrations from-ipfs docs: improved docs and logging for migrations from-ipfs May 26, 2025
@smrz2001 smrz2001 merged commit 910cdf8 into ceramicnetwork:main May 26, 2025
17 of 19 checks passed
@smrz2001 smrz2001 mentioned this pull request May 26, 2025
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.

4 participants