Skip to content

Fix forget host-call incorrectly dropping preimage - #545

Open
zdave-parity wants to merge 1 commit into
mainfrom
dave/fix-forget
Open

Fix forget host-call incorrectly dropping preimage#545
zdave-parity wants to merge 1 commit into
mainfrom
dave/fix-forget

Conversation

@zdave-parity

Copy link
Copy Markdown
Collaborator

As we can not know the length of a preimage prior to it being provided, we allow multiple requests with the same hash but differing lengths to be made. Only a request with the correct length can ever be satisfied and transition to a provided state. We must only drop the preimage when we drop a request which is in a provided state. A request in the requested state (empty status sequence) does not imply that we do not have the preimage; its length may be incorrect and another request with the correct length may be in a provided state.

As we can not know the length of a preimage prior to it being provided,
we allow multiple requests with the same hash but differing lengths to
be made. Only a request with the correct length can ever be satisfied
and transition to a provided state. We must only drop the preimage when
we drop a request which is in a provided state. A request in the
requested state (empty status sequence) does _not_ imply that we do not
have the preimage; its length may be incorrect and another request with
the correct length may be in a provided state.
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.

2 participants