You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any log can be submitted to network infinite times, and the subscriber would be invoked every time.
Goal
Keep track of every submitted log.
Check if log has been submitted before in submitLog.
And let relayers know (by emitting events) which ones have been submitted.
Possible solutions
Store the root of a sparse merkle tree on-chain.
Relayers would have to, in addition to submitting log proofs, provide proof of non-inclusion of log in the SMT.
Contracts wouldn't be able to query ethbase to see if a log has been emitted recently.
Each block, only one transaction would modify the merkle root, and the rest of txes will fail, as their proof becomes invalid. Discussion regarding this issue.
The text was updated successfully, but these errors were encountered:
Building any tree structure on-chain will be more expensive than a simple dictionary/mapping check of 'has log been submitted before'. Keep it simple, if you want to prevent replays, use a dictionary of 'events which have been relayed'. e.g. building a tree on-chain will cost at least O(log2(N)) storage operations per insert, whereas just keeping a simple mapping is O(1). The average and worst cases for on-chain SMT are much higher than the KISS solution.
Now
Any log can be submitted to network infinite times, and the subscriber would be invoked every time.
Goal
submitLog
.Possible solutions
The text was updated successfully, but these errors were encountered: