Skip to content

Restrictions on bridge-unlock-action contents are too strict #1471

@SuperFluffy

Description

@SuperFluffy

Sequencer currently imposes that the field astria.protocol.transactions.v1alpha1.BridgeUnlockAction.rollup_withdrawal_event_id has a length no more than 64 bytes.

This creates an issue when wanting to write the native formatting of a eth TX hash into this field, which is of the form 0x<hex-of-64-bytes>, for a total length of 130 bytes.

Very likely the restriction on the memo length is similarly too strict.

impl ActionHandler for BridgeUnlockAction {
// TODO(https://github.com/astriaorg/astria/issues/1430): move checks to the `BridgeUnlock` parsing.
async fn check_stateless(&self) -> Result<()> {
ensure!(self.amount > 0, "amount must be greater than zero",);
ensure!(self.memo.len() <= 64, "memo must not be more than 64 bytes");
ensure!(
!self.rollup_withdrawal_event_id.is_empty(),
"rollup withdrawal event id must be non-empty",
);
ensure!(
self.rollup_withdrawal_event_id.len() <= 64,
"rollup withdrawal event id must not be more than 64 bytes",
);
ensure!(
self.rollup_block_number > 0,
"rollup block number must be greater than zero",
);
Ok(())
}

┆Issue Number: ENG-802

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions