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

Move to height->header index #220

Open
cristaloleg opened this issue Oct 9, 2024 · 4 comments
Open

Move to height->header index #220

cristaloleg opened this issue Oct 9, 2024 · 4 comments
Assignees

Comments

@cristaloleg
Copy link
Contributor

In most cases we don't need an index hash->header but rather height->header.

@cristaloleg cristaloleg self-assigned this Oct 9, 2024
@Wondertan
Copy link
Member

One thing I recalled is that this might change with backward sync. We may want to request a range of headers with hash + number of headers before. This way, as we know the hash is valid, we can simply verify the validity of the whole range in a stateless manner. Requesting everything with heights, on the other hand, would require external state.

@renaynay
Copy link
Member

@Wondertan I'm assuming the hash you're discussing here is the TrustedHead (either some trusted peers gave it to us or we found through "social discovery") and we pass it to the node. We could also use the height here and pass in the hash to ensure the height we've requested == the hash we trust, and then work our way backwards (where all the reference information we need is in the headers we've already processed and verified (as header contains LastBlockID)

@Wondertan
Copy link
Member

That's true, statelessness can be achieved solely with interfaces. The hash then doesn't even need to be part of the protocol, as it is right now.

@Wondertan
Copy link
Member

Wondertan commented Nov 20, 2024

One more thing to consider. We kept hash addressability in Shwap's storage. @adlerjohn , @walldiss and I couldnt find a compelling usecase for it but still decided to keep around as more like a standard to expose that. I would remove it everywhere after we know for sure its useless, assuming it brings unnoticeable maintanance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants