-
Notifications
You must be signed in to change notification settings - Fork 764
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
Workaround for https://github.com/LedgerHQ/app-ethereum/issues/409 #2192
Conversation
now ready for review 🖖 |
// workaround for https://github.com/LedgerHQ/app-ethereum/issues/409 | ||
// TODO: remove in future version | ||
let chunk_size = | ||
(0..=255).rev().find(|i| payload.len() % i != 3).expect("true for any length"); |
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.
finds the largest chunk size that does not leave 3 hanging bytes on the payload lol
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.
ridiculous
2ece0a5
to
b1ec9ce
Compare
// workaround for https://github.com/LedgerHQ/app-ethereum/issues/409 | ||
// TODO: remove in future version | ||
let chunk_size = | ||
(0..=255).rev().find(|i| payload.len() % i != 3).expect("true for any length"); |
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.
ridiculous
guard.record("index", index); | ||
guard.record("chunk", hex::encode(chunk)); |
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.
TIL
makes chunk size dynamic to avoid running into this:
LedgerHQ/app-ethereum#409
Motivation
foundry-rs/foundry#4362
Solution
PR Checklist