Skip to content

feat: implement system message to revalidate a user message with external proofs#670

Open
aditiharini wants to merge 4 commits intomainfrom
revalidate-message
Open

feat: implement system message to revalidate a user message with external proofs#670
aditiharini wants to merge 4 commits intomainfrom
revalidate-message

Conversation

@aditiharini
Copy link
Copy Markdown
Contributor

@aditiharini aditiharini commented Sep 9, 2025

Implement a system message that revalidates an existing message and revokes it if invalid. This will be used to remove username proofs that are no longer valid and other messages that were once valid but aren't any longer.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
snapchain-docs Ready Ready Preview Comment Sep 10, 2025 2:17am

&revalidate_message.message.as_ref().unwrap(),
txn_batch,
) {
self.update_trie(trie_ctx, &event, txn_batch)?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it might be worth logging here if we're revoking due to a revalidate. I don't think we have any other visibility into the fact that revalidates are happening?

_ => {}
};

self.validate_user_message(&message, timestamp, version, true, txn_batch)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why hardcode true for is_pro_user?

Copy link
Copy Markdown
Contributor Author

@aditiharini aditiharini Sep 13, 2025

Choose a reason for hiding this comment

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

We need to determine if the user was a pro user at the block timestamp where the message was originally processed in order to infer this state correctly. We don't have a good way to go from message -> block right now. Defaulting to true essentially always allows the pro-user specific features and bypasses this validation.

}
}

system_messages_count += 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should emit a metric for revalidate messages somewhere. Otherwise we'd have no visibility that these messages are being submitted and processed.

Ok(count)
}

pub fn validate_ens_username_proof(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be nice to re-use this during the normal validation path, but not a big deal.

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