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

reject txn with namespace > u32::max #1504

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sequencer/src/api/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ where
let tx = req
.body_auto::<Transaction, Ver>(Ver::instance())
.map_err(Error::from_request_error)?;

// Transactions with namespaces that do not fit in the u32
// cannot be included in the block.
// TODO: This issue will be addressed in the next release.
if tx.namespace() > NamespaceId::from(u32::MAX as u64) {
return Err(Error::Custom {
message: "Transaction namespace > u32::MAX".to_string(),
status: StatusCode::BadRequest,
});
}

let hash = tx.commit();
state
.submit(tx)
Expand Down
Loading