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

Need to verify a block contains the expected number of hashes #4282

Closed
mvines opened this issue May 14, 2019 · 7 comments · Fixed by #6262
Closed

Need to verify a block contains the expected number of hashes #4282

mvines opened this issue May 14, 2019 · 7 comments · Fixed by #6262
Assignees

Comments

@mvines
Copy link
Member

mvines commented May 14, 2019

When we enable real PoH, ticks will always be separated from the previous tick by a well-known number of hashes. Blocks that do not contain this expected separation should be rejected as malformed, as that indicates somebody trying to propose a "short block".

blocktree_processor.rs is likely where this additional verification should go.

@jstarry
Copy link
Member

jstarry commented Sep 24, 2019

@mvines I'm confused by this comment: https://github.com/solana-labs/solana/blob/master/core/src/entry.rs#L89 Is it outdated? A tick should have poh.hashes_per_tick right?

@jstarry
Copy link
Member

jstarry commented Sep 24, 2019

Should both tick entries and transaction entries have the same number of hashes? It looks that way from poh.rs but not confident

@jstarry
Copy link
Member

jstarry commented Sep 24, 2019

Should verification be disabled when hashes_per_tick == None? I think it would be nice to cleaner to remove the possibility of hashes_per_tick being None and instead setting it to a small number.. Thoughts?

@jstarry
Copy link
Member

jstarry commented Sep 24, 2019

Looks like slot 0 gets filled with ticks with only 1 hash each https://github.com/solana-labs/solana/blob/master/core/src/entry.rs#L369. Is this by design or should it be updated to use the hashes_per_tick config value?

@mvines
Copy link
Member Author

mvines commented Sep 24, 2019

Should both tick entries and transaction entries have the same number of hashes? It looks that way from poh.rs but not confident

Not necessarily. The sum of hashes in all entries leading up to an including the next tick entry should totally hashes_per_tick

@mvines
Copy link
Member Author

mvines commented Sep 24, 2019

Should verification be disabled when hashes_per_tick == None? I think it would be nice to cleaner to remove the possibility of hashes_per_tick being None and instead setting it to a small number.. Thoughts?

Small number probably won't work as even at None, each entry with transactions within it will get at least 1 hash. So a small number would artificially limit to number of transactions that can end up in a given tick.

@mvines
Copy link
Member Author

mvines commented Sep 24, 2019

Looks like slot 0 gets filled with ticks with only 1 hash each https://github.com/solana-labs/solana/blob/master/core/src/entry.rs#L369. Is this by design or should it be updated to use the hashes_per_tick config value?

It should be updated as well

behzadnouri added a commit to behzadnouri/solana that referenced this issue Jan 5, 2025
…olana-labs#4282)

With Merkle shreds, leader signs the Merkle root of the erasure batch
and all shreds within the same erasure batch have the same signature.
For recovered shreds, the (unique) signature is copied from shreds which
were received from turbine (or repair) and are already sig-verified.
The same signature also verifies for recovered shreds because when
reconstructing the Merkle tree for the erasure batch, we will obtain the
same Merkle root.
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 a pull request may close this issue.

2 participants