-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Ignore messages with duplicated nonces #2375
base: master
Are you sure you want to change the base?
Changes from 4 commits
ee44841
f0f34d6
3e858d9
7270cd0
fe970df
d355d48
6d1edd6
3e834c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -812,7 +812,7 @@ where | |
D: KeyValueInspect<Column = Column>, | ||
{ | ||
let forced_transactions = if self.relayer.enabled() { | ||
self.process_da( | ||
self.process_l1_events( | ||
block_height, | ||
da_block_height, | ||
data, | ||
|
@@ -875,7 +875,7 @@ where | |
} | ||
} | ||
|
||
fn process_da<D>( | ||
fn process_l1_events<D>( | ||
&mut self, | ||
block_height: BlockHeight, | ||
da_block_height: DaBlockHeight, | ||
|
@@ -916,9 +916,15 @@ where | |
if message.da_height() != da_height { | ||
return Err(ExecutorError::RelayerGivesIncorrectMessages) | ||
} | ||
block_storage_tx | ||
.storage_as_mut::<Messages>() | ||
.insert(message.nonce(), &message)?; | ||
let message_nonce = message.nonce(); | ||
if !block_storage_tx | ||
.storage_as_ref::<Messages>() | ||
.contains_key(message_nonce)? | ||
{ | ||
block_storage_tx | ||
.storage_as_mut::<Messages>() | ||
.insert(message_nonce, &message)?; | ||
} | ||
execution_data | ||
.events | ||
.push(ExecutorEvent::MessageImported(message)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this also be conditional to the message_nonce not being already present in the block storage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. I've moved it. This makes me wonder if we should be including an event in the case that a message is skipped. Or add it to a list of skipped messages, similar to the skipped tx. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should have the info somewhere that we manage a message with this nonce at this height and ignored this can be important to debug, index... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask you to rename this method please?=D
message.id()
for me meansMessageId
return type, while it is not true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a
nonce
method that returns the same thing asid
. Very silly.