-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Failure test case #750
Failure test case #750
Conversation
nice job, I don't understand it yet. |
|
||
// NOTE: if Entry grows to larger than a transaction, the code below falls over | ||
let threshold = (BLOB_DATA_SIZE / 256) - 1; // 256 is transaction size | ||
let threshold = (BLOB_DATA_SIZE / PACKET_DATA_SIZE) - 1; |
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.
PACKET_DATA_SIZE may be the wrong magic number, what you want is sizeof(Transaction)
the test also assumes that the rest of an Entry struct is smaller than a Transaction (hence the -1)
threshold should be (BLOB_DATA_SIZE - serialized_size(Entry)) / serialized_size(Transaction), assuming there's zero overhead for typing in serialization of an Entry (which holds a Vector of Transactions)
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.
Ideally we would use sizeof(serialized Transaction) no? But we don’t have a way to generate that other than serializing all the different types of Transactions at runtime. sizeof(Transaction), the in-memory representation, is more than 300 bytes. But when serialized always must be less than 256, which I think is what this const represents
I understand it now, working on a fix. |
❤️. I was going to write a fix after 🚲 but thanks! |
my inclination is to just do the /256 thing instead of messing around with will_fit() |
Subsumed by #751 |
Test that reproduces the crash at #740