Skip to content

Corrupted storages#12

Merged
CertainLach merged 8 commits intomasterfrom
corrupted-storages
Oct 7, 2025
Merged

Corrupted storages#12
CertainLach merged 8 commits intomasterfrom
corrupted-storages

Conversation

@vklachkov
Copy link
Contributor

@vklachkov vklachkov commented Oct 6, 2025

Blocked by #11.

Adds an option to "repair" storage with a default value and significantly improves logging for decoding errors.

@CertainLach
Copy link
Member

And how it's after PR:

ERROR baedeker: runtime error: failed to rebuild storage LastRateLimitedBlock: failed to decode OwnerHyperparamUpdate variant: broken field 0: codec: not enough bytes to decode u16: expected 2 bytes, but only 0 byte is available

Вообще там под ошибкой ещё стектрейс есть, и из него большая часть информации о пути ошибки доступна, в него же и надо дополнительную информацию внедрять

По аналогии с context() из anyhow используй метод description() на Resultах

@vklachkov vklachkov marked this pull request as ready for review October 7, 2025 12:51
@vklachkov vklachkov requested a review from CertainLach October 7, 2025 12:51
where
Self: parity_scale_codec::Decode,
{
fn decode<I: Input>(input: &mut I) -> Result<Self> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переименовать бы, что бы было понятно что это не из оригинального Decode метод

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Специально не переименовывал, чтобы не было никакой разницы с оригинальным Decode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но она есть, нужно дёргать этот метод а не оригинальный decode)

Copy link
Member

@CertainLach CertainLach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кроме двух nitpicks всё хорошо, через пару часов подготовлю релиз chainql для baedeker, если не успеешь их исправить - исправлю сам когда буду версию бампать и т.д

@CertainLach CertainLach merged commit cc26a0e into master Oct 7, 2025
@CertainLach CertainLach deleted the corrupted-storages branch October 7, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants