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

use the message store for mempool validation #218

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

aditiharini
Copy link
Contributor

Switch from using the trie to the account store for the duplicate message check in the mempool.

@aditiharini aditiharini marked this pull request as ready for review January 15, 2025 03:50
@aditiharini aditiharini changed the title Use message store for mempool validation use the message store for mempool validation Jan 15, 2025
@aditiharini aditiharini merged commit 237d814 into main Jan 15, 2025
2 checks passed
@aditiharini aditiharini deleted the use-message-store-for-mempool-validation branch January 15, 2025 04:38
let set_postfix = type_to_set_postfix(message_data.r#type());
let primary_key =
make_message_primary_key(fid, set_postfix as u8, Some(&ts_hash));
let existing_message = get_message_by_key(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is too low level for the mempool. It should just be doing stores.message_exists(&message);

},
MempoolMessage::ValidatorMessage(message) => {
if let Some(onchain_event) = &message.on_chain_event {
match stores.onchain_event_store.exists(&onchain_event) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would push this into stores.onchain_event_exists as well.

match &fname_transfer.proof {
None => return false,
Some(proof) => {
let username_proof = UserDataStore::get_username_proof(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

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