-
Notifications
You must be signed in to change notification settings - Fork 86
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(sequencer)!: implement BridgeTransfer
action
#1934
base: main
Are you sure you want to change the base?
Conversation
|
||
// The memo field can be used to provide unique identifying additional | ||
// information about the bridge unlock transaction. | ||
string memo = 5; |
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.
Do we need a memo here?
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.
not necessarily, do you see any future use for it? i left it because BridgeUnlock has it, but don't think BridgeUnlock necessarily needs it either. removed for now
Can we have smoke tests for this? |
crates/astria-sequencer/src/action_handler/impls/bridge_lock.rs
Outdated
Show resolved
Hide resolved
crates/astria-sequencer/src/action_handler/impls/bridge_unlock.rs
Outdated
Show resolved
Hide resolved
Request to expand the background section: why this over a bridge-lock followed by bridge-unlock? Execution of our transactions is by definition atomic (because processing of transactions (and their actions) is sequential). Is the atomicity of bridge-lock-unlock not enough? Does this mean that the only innovation of this feature is a different deposit being emitted? Is there another reason to have this? Could we address this by amending how we emit deposit events? |
the issue isn't deposit events. the issue is that |
Please add this to the PR description before merging. |
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.
astria-core
needs an entry for this change.
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.
approving for snapshot changes + proto changes. One small nit on the validation.
Noting by default this action can't be done as it is disabled because there are no fees, correct?
/// - if the `to` field is invalid | ||
/// - if the `amount` field is invalid | ||
/// - if the `fee_asset` field is invalid | ||
/// - if the `from` field is invalid |
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.
should there also be validation that the destination_chain_address
is set, as well as some restrictions on it's length?
Maybe this is more a sequencer concern, notice we don't have this on bridge lock but probably should? There's a limit to what a reasonable sized destination address is.
Summary
implement
BridgeTransfer
action which transfers funds from one bridge account to another. essentially, it atomically performs aBridgeUnlock
and aBridgeLock
.Background
this is functionality we want and
BridgeUnlock
ing to another bridge account wouldn't create aDeposit
correctly. the issue is thatBridgeUnlock
does not contain all the information needed to create a deposit event, namelydestination_chain_address
, soBridgeUnlock
directly into another bridge account doesn't work as a lock.BridgeLock
from a bridge account to another also doesn't contain the desired withdrawal information (egrollup_withdrawal_event_id
). an atomicBridgeUnlock
/BridgeLock
combo would only work if theBridgeUnlock
unlocks the funds to itself, providingrollup_withdrawal_event_id
, and thenBridgeLock
s to the receiving account.BridgeUnlock
cannot go directly into a different account as the bridge would no longer be able to access it. however this seems unwieldly as opposed to just having one action which makes the intention clear.Changes
BridgeUnlock
to move checks to their own functionBridgeLock
to move execution andDeposit
emission to their own functionBridgeTransfer
action using existingBridgeUnlock
checks andBridgeLock
execution logic.Testing
unit tests
Changelogs
Changelogs updated.
Breaking Changelist
Related Issues
closes #1921