fix(sequencer)!: store native asset ibc->trace mapping in init_chain#1242
fix(sequencer)!: store native asset ibc->trace mapping in init_chain#1242
Conversation
| let native_asset = crate::asset::get_native_asset(); | ||
| if let Some(trace_native_asset) = native_asset.as_trace_prefixed() { | ||
| state_tx | ||
| .put_ibc_asset(trace_native_asset) | ||
| .context("failed to put native asset")?; | ||
| } else { | ||
| bail!("native asset must not be in ibc/<ID> form") | ||
| } |
There was a problem hiding this comment.
what's going on with indent here? it feels like there is a missing block here?
There was a problem hiding this comment.
The indent is actually fine - github code wrapping makes this look a bit weird if your window is too narrow.
There was a problem hiding this comment.
Oh wow that was cursed. dammit github
SuperFluffy
left a comment
There was a problem hiding this comment.
That was my oversight, thank you for fixing it.
I actually want to get rid of these globals (meaning the native asset one here and the base address prefix), and instead have a new StateExt where these are read everytime they are needed.
I believe this should have a negligible impact on performance, makes testing easier, and would avoid errors such this one.
| let native_asset = crate::asset::get_native_asset(); | ||
| if let Some(trace_native_asset) = native_asset.as_trace_prefixed() { | ||
| state_tx | ||
| .put_ibc_asset(trace_native_asset) | ||
| .context("failed to put native asset")?; | ||
| } else { | ||
| bail!("native asset must not be in ibc/<ID> form") | ||
| } |
There was a problem hiding this comment.
The indent is actually fine - github code wrapping makes this look a bit weird if your window is too narrow.
|
Added an exclamation mark, as in |
* main: feat(cli): add cmd to collect withdrawal events and submit as actions (#1261) fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266) fix(withdrawer): support withdrawer address that differs from bridge address (#1262) (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260) fix(charts): add resources for sequencer/cometbft (#1254) chore(sequencer)!: add metrics (#1248) fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243) feat(core, proto)!: make bridge unlock memo string (#1244) fix(conductor): don't panic during panic (#1252) feat(core)!: lowerCamelCase for protobuf json mapping (#1250) refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190) fix: rollup archive node configurations (#1249) refactor(core, bridge-withdrawer)!: move bridge-unlock memo to core (#1245) fix(sequencer)!: store native asset ibc->trace mapping in init_chain (#1242)
…1242) ## Summary we need to store the native asset ibc to "trace" mapping in the state, otherwise queries for the native asset using the ID will fail. for example `get_bridge_account_info` where the asset is the native asset fails right now ## Changes - store native asset ibc->trace mapping in `init_chain` - also enforce that the native asset is is "trace" form, as otherwise, we won't be able to map from ibc->trace form for the asset as we don't know the trace form. ## Breaking changes - this is unfortunately breaking since the ibc->trace mapping is stored in app state.
Summary
we need to store the native asset ibc to "trace" mapping in the state, otherwise queries for the native asset using the ID will fail. for example
get_bridge_account_infowhere the asset is the native asset fails right nowChanges
init_chainBreaking changes