feat: implement system message to revalidate a user message with external proofs#670
feat: implement system message to revalidate a user message with external proofs#670aditiharini wants to merge 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| &revalidate_message.message.as_ref().unwrap(), | ||
| txn_batch, | ||
| ) { | ||
| self.update_trie(trie_ctx, &event, txn_batch)?; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Why hardcode true for is_pro_user?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Would be nice to re-use this during the normal validation path, but not a big deal.
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.