paritytech / paritytech/frame-decode
Kusama Asset Hub fail to decode Account Info (type ID 1) on early blocks
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Description
While trying to decode Account Info (type ID 1) in polkadot-rest-api (code), the below error message is returned:
{
"error": "Balance query failed: Failed to decode storage value: Failed to decode account info"
}
Chain: Kusama Asset Hub
Block: 10004
Example Request
v1/accounts/1HwQbUpcr99UA6W7WBK86RtMHJTBWRazpxuYfRHyhSCbE1j/balance-info?at=10004
Attempting to Decode with scale_value::Value<()>
Attempting to decode with scale_value::Value<()> also fails.
If replacing this code
let decoded: Value<()> = value.decode_as().map_err(|_e| {
BalanceQueryError::DecodeFailed(parity_scale_codec::Error::from(
"Failed to decode account info",
))
})?;
with this code
let decoded: Value<()> = match value.decode_as() {
Ok(v) => v,
Err(e) => {
match value.decode_as::<scale_value::Value<()>>() {
Ok(raw) => {
tracing::error!(
"decode_account_info: decode_as failed ({e}), but raw Value decoded as: {raw:?}"
);
}
Err(raw_err) => {
tracing::error!(
"decode_account_info: both decode_as ({e}) and raw Value decode ({raw_err}) failed — likely missing or incorrect legacy types"
);
}
}
return Err(BalanceQueryError::DecodeFailed(
parity_scale_codec::Error::from("Failed to decode account info"),
));
}
};
it returns
2026-02-11T13:54:27.657540Z ERROR server::handlers::common::accounts::balance_info: crates/server/src/handlers/common/accounts/balance_info.rs:229: decode_account_info: both decode_as (Cannot decode storage value: Cannot decode value with type ID 1:
Error { context: Context { path: [] }, kind: VisitorDecodeError(CodecError(Error { cause: None, desc: "Not enough data to fill buffer" })) }) and raw Value decode (Cannot decode storage value: Cannot decode value with type ID 1:
Error { context: Context { path: [] }, kind: VisitorDecodeError(CodecError(Error { cause: None, desc: "Not enough data to fill buffer" })) }) failed — likely missing or incorrect legacy types
2026-02-11T13:54:27.657753Z ERROR http: crates/server/src/logging/http_logger.rs:67: GET /v1/accounts/1HwQbUpcr99UA6W7WBK86RtMHJTBWRazpxuYfRHyhSCbE1j/balance-info?at=10004 500 280ms method=GET path=/v1/accounts/1HwQbUpcr99UA6W7WBK86RtMHJTBWRazpxuYfRHyhSCbE1j/balance-info?at=10004 status=500 duration_ms=280
2026-02-11T13:54:27.657807Z ERROR tower_http::trace::on_failure: /Users/dominique/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tower-http-0.6.8/src/trace/on_failure.rs:93: response failed classification=Status code: 500 Internal Server Error latency=280 ms
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/server/src/handlers/common/accounts/balance_info.rs around the account-info decoding path and reproduce the request for Kusama Asset Hub at block 10004. Trace why type ID 1 produces the reported SCALE decoding error, then verify that the balance-info endpoint decodes this account successfully without a 500 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100