forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mempool] estimate in-memory size using BCS raw transaction (aptos-la…
…bs#4193) ### Description The previous implementation does not work; it would just output the size of the static parts of the struct so all transactions had the same estimate. Instead we replace with BCS raw transaction size. While this does not show an exact allocation of bytes it is a good stand-in estimate -- as BCS does not attempt to compress or otherwise reduce data (e.g., RLE). The BCS size is cached and later used to compute size on broadcast. So this only requires more work for transactions that end up not being broadcasted. ### Test Plan Added a unit test that shows relative difference in estimated sizes. This previously failed in main because the sizes outputted were the same.
- Loading branch information
Showing
2 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters