-
Notifications
You must be signed in to change notification settings - Fork 76
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(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs #1209
Conversation
cab1204
to
476e4fa
Compare
@@ -69,6 +69,9 @@ ASTRIA_COMPOSER_METRICS_HTTP_LISTENER_ADDR="127.0.0.1:9000" | |||
# The address at which the gRPC collector and health services are listening. | |||
ASTRIA_COMPOSER_GRPC_ADDR="0.0.0.0:0" | |||
|
|||
# The asset to use for paying for transactions submitted to sequencer. | |||
ASTRIA_COMPOSER_FEE_ASSET="nria" |
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.
Note that this sets the payment fee for all actions to nria
- the same as was previously hard coded. This might not be exactly what we want to do in the future.
seq_action: SequenceAction, | ||
}, | ||
#[error(transparent)] | ||
FinishedQueueFull(Box<FinishedQueueFull>), |
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.
This is a clippy-fix because the variant was too big.
@@ -1,19 +1,22 @@ | |||
#[cfg(test)] |
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 structure of these modules was extremely strange and needed to be updated.
@@ -96,18 +99,16 @@ fn preprocess_request(params: &[(String, String)]) -> anyhow::Result<asset::Id, | |||
..response::Query::default() | |||
}); | |||
}; | |||
let asset_id = hex::decode(asset_id) | |||
let asset = <[u8; 32]>::from_hex(asset_id) |
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.
I am torn on this one. The request still has the form asset/denom/<hex>
. So asset/denom/ibc/<hex>
isn't allowed, and neither is asset/denom/port/channel/base
.
...s/snapshots/astria_sequencer__accounts__state_ext__tests__storage_keys_have_not_changed.snap
Outdated
Show resolved
Hide resolved
crates/astria-bridge-withdrawer/src/bridge_withdrawer/submitter/mod.rs
Outdated
Show resolved
Hide resolved
@@ -369,7 +369,7 @@ pub struct SequenceAction { | |||
pub rollup_id: RollupId, | |||
pub data: Vec<u8>, | |||
/// asset to use for fee payment. | |||
pub fee_asset_id: asset::Id, | |||
pub fee_asset: asset::Denom, |
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.
we should enforce for all actions that if the denom trace is >32 bytes, it must be in ibc/
prefixed form. ie don't accept traces that are excessively long as it's a DOS vector
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 you mean we should enforce this when parsing string fee_asset -> asset::Denom
? Technically the upper limit for protobuf payloads is 4MB and sequencer just rejects payloads >200KB, but I can add an additional limit on the type of course.
9374b33
to
e968da4
Compare
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.
looks good, great 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.
approval for infra components
f06975d
to
9df3bd7
Compare
* main: (27 commits) refactor(sequencer): fix prepare proposal metrics (#1211) refactor(bridge-withdrawer): move generated contract bindings to crate (#1237) fix(sequencer) fix wrong metric and remove unused metric (#1240) feat(sequencer): implement transaction fee query (#1196) chore(cli)!: remove unmaintained rollup subcommand (#1235) release(sequencer): 0.14.1 patch release (#1233) feat(sequencer-utils): generate example genesis state (#1224) feat(sequencer): implement abci query for bridge account info (#1189) feat(charts): bridge-withdrawer, smoke test, various chart improvements (#1141) chore(charts): update for new geth update (#1226) chore(chart)!: dusk-8 chart version updates (#1223) release(conductor): fix conductor release version (#1222) release: dusk-8 versions (#1219) fix(core): revert `From` ed25519_consensus types for crypto mod (#1220) Refactor(chart, sequencer): restructure sequencer chart, adjust configs (#1193) refactor(withdrawer): read from block subscription stream and get events on each block (#1207) feat(core): implement with verification key for address builder and crypto improvements (#1218) feat(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs (#1209) chore(chart): update evm chart for new prefix field (#1214) chore: bump penumbra deps (#1216) ...
Summary
Replaces the bare asset ID bytes by full IBC ICS20 denoms.
Background
Bare denom IDs in public APIs are difficult to understand. While IBC ICS20 denoms are prescribed to either contain strings of the form
port/channel/denom
oribc/<sha256-hex>
, due to protobuf-to-json mapping protobufbytes
are always encoded as base64. With #1181 we parse denoms into either of the two forms and can thus allow users to provide assets as protobufstring
s which are then parsed by sequencer.In addition, since denominations of the form
port/channel/denom
can always be converted toibc/<sha256>
, this allows for more elegant fetching of denom-related data from storage.Changes
bytes asset_id -> string asset
bytes fee_asset_id -> string fee_asset
repeated bytes fee_asset_ids -> repeated string fee_assets
(and renameAllowedFeeAssetIdsResponse
toAllowedFeeAsssetsRersponse
)astria-core
types to parse the asset strings toastria_core::primitive::v1::asset::Denom
s instead of[u8; 32]
arrays.astria_core::primitive::v1::asset::Id
typeStateWriteExt
andStateWriteRead
types that read or write assets to disk:asset::Id
s (in practice[u8; 32]
), they now writeasset::IbcPrefixed
TAsset: Into<asset::IbcPrefixed>
which allows fetching data usingastria::Denom
s,astria::TracePrefixed
, orastria::IbcPrecixed
astria-cli
subcommands that construct actions with assets to have arguments--asset
or--fee-asset
(using"nria"
as the default if not provided)ASTRIA_COMPOSER_FEE_ASSET
Testing
All tests that involve fees were updated and pass again.
Breaking Changelist