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

add duplicate message validation to mempool #202

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

aditiharini
Copy link
Contributor

Throw away messages that already exist in the trie in the mempool before forwarding to the engine.

@aditiharini aditiharini marked this pull request as ready for review January 8, 2025 15:31
@aditiharini aditiharini merged commit 6be566a into main Jan 8, 2025
2 checks passed
@aditiharini aditiharini deleted the add-pull-based-mempool branch January 8, 2025 15:36
Some(stores) => {
// TODO(aditi): The engine reloads its ref to the trie on commit but we maintain a separate ref to the trie here.
stores.trie.reload(&stores.db).unwrap();
match stores.trie.exists(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, yeah, this is going to be an issue. We shouldn't let this leak out of the trie. Maybe one approach is to make the trie non clonable, and the have a readonly trie that always reads from the db isntead of storing anything in memory.

But at a higher level, we shouldn't use the trie for the duplicate check, it would be too slow. Read from the db directly and we can have a separate caching layer here if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants