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

Failure test case #750

Closed
wants to merge 1 commit into from
Closed

Failure test case #750

wants to merge 1 commit into from

Conversation

mvines
Copy link
Member

@mvines mvines commented Jul 25, 2018

Test that reproduces the crash at #740

@mvines mvines added work in progress This isn't quite right yet noCI Suppress CI on this Pull Request labels Jul 25, 2018
@rob-solana
Copy link
Contributor

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;
Copy link
Contributor

@rob-solana rob-solana Jul 25, 2018

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)

Copy link
Member Author

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

@rob-solana
Copy link
Contributor

I understand it now, working on a fix.

@mvines
Copy link
Member Author

mvines commented Jul 25, 2018

❤️. I was going to write a fix after 🚲 but thanks!

@rob-solana
Copy link
Contributor

my inclination is to just do the /256 thing instead of messing around with will_fit()

@mvines
Copy link
Member Author

mvines commented Jul 25, 2018

Subsumed by #751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noCI Suppress CI on this Pull Request work in progress This isn't quite right yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants