Skip to content
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

feat(protocol): allow someone to ack message reception then invoke the message before others to earn the fee #15563

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jan 25, 2024

Allow someone to ack the reception of a message then be the preferred transactor to invoke the transaction before any other addresses (including the message's owner). This solves the fee issue:

A challenge is that the previous message.fee is designed for a one-step process, now with a two-step process, in theory we need two fees, one for each step, but this is not implemented in this PR as it will have data incompatibility issue.

@dantaik dantaik marked this pull request as ready for review January 25, 2024 04:45
Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
bridge-ui-v2-a6 ✅ Ready (Inspect) Visit Preview Jan 25, 2024 4:46am

@@ -95,8 +95,9 @@ contract Bridge is EssentialContract, IBridge {
external
onlyFromNamed("bridge_watchdog")
{
uint64 _timestamp = toPause ? type(uint64).max : uint64(block.timestamp);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess have to be a bit careful here because the timestamp is used to do math on, and so if that math is done on uint64s it may overflow. I think currently it's fine because the value is upcasted to uint256s when it's used in math, and also the transactions reverting with overflow is okay for these messages.

@dantaik dantaik merged commit 44e5462 into bridge_invocation_delay Jan 26, 2024
12 of 13 checks passed
@dantaik dantaik deleted the handle_fees branch January 26, 2024 13:55
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