-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add DepositMessageDelivered event #99
base: develop
Are you sure you want to change the base?
Conversation
Just noting that this adds around 1.1k gas to all delayed messages and batch spending reports |
src/bridge/AbsBridge.sol
Outdated
@@ -203,6 +203,7 @@ abstract contract AbsBridge is Initializable, DelegateCallAware, IBridge { | |||
baseFeeL1, | |||
blockTimestamp | |||
); | |||
emit MessageDeliveredV2(kind, sender); |
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.
Might make more sense to have this event in the depositETH function so it does not add gas usage to other types of inbox messages. Can you elaborate more on the usecase of this feature?
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.
The main usecase is for a bridge application to show a user their deposits. Normally the MessageDelivered event is used for this, however since address is not indexed in this event, deposits for all users have to be queried which is much less efficient and may requires multiple requests. Agreed that the event only needs to be emitted for deposit events - updated the logic to reflect that, which should save on gas.
This event allows bridges to efficiently query the deposit history for an address without requiring an external indexer.
39511bb
to
187879e
Compare
only emit this event for deposit messages to save gas
187879e
to
a51c411
Compare
This event allows bridges to efficiently query the deposit history for an address without requiring an external indexer.