-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix the wasm substitute caching bug #64
Conversation
@rimbi please rebase the PR, it doesn't seem correct |
sorry for the inconvenience, ready for review again @crystalin @nbaztec @librelois |
let runtime_code = RuntimeCode { | ||
code_fetcher: &WrappedRuntimeCode((&code).into()), | ||
heap_pages: None, | ||
hash: Vec::new(), | ||
hash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash, | |
hash: make_hash(&code), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks 👍
@@ -123,10 +123,13 @@ where | |||
let substitutes = substitutes | |||
.into_iter() | |||
.map(|(block_number, code)| { | |||
let mut hasher = DefaultHasher::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut hasher = DefaultHasher::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks 👍
@@ -123,10 +123,13 @@ where | |||
let substitutes = substitutes | |||
.into_iter() | |||
.map(|(block_number, code)| { | |||
let mut hasher = DefaultHasher::new(); | |||
hasher.write(&code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasher.write(&code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks 👍
@@ -123,10 +123,13 @@ where | |||
let substitutes = substitutes | |||
.into_iter() | |||
.map(|(block_number, code)| { | |||
let mut hasher = DefaultHasher::new(); | |||
hasher.write(&code); | |||
let hash = hasher.finish().to_ne_bytes().to_vec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let hash = hasher.finish().to_ne_bytes().to_vec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks 👍
Fix the wasm substitute caching bug
Fix the wasm substitute caching bug.
When there exist multiple code substitutes in the spec, the used to keep only one. The current solution fixes this bug by creating a unique hash for each wasm blob.