8000 Use safeAdd to avoid overflow in the mempool isFull() condition check · Issue #2537 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use safeAdd to avoid overflow in the mempool isFull() condition check #2537

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

Open
andynog opened this issue Mar 7, 2024 · 0 comments
Open
Labels

Comments

@andynog
Copy link
Contributor
andynog commented Mar 7, 2024

In #2498 some logic was added to avoid overflows, but as mentioned in a comment on its backport to v1.x, the logic introduced does not really prevent overflows.

The right way of implementing this condition check would be using a safeAdd method for txSize+txsBytes

But it seems we don't have support for int64 methods in safemath

We have some logic in the validator_set for that that probably could be implemented in safemath to be used in different places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Todo
Development

No branches or pull requests

2 participants
0