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

Block processor fails to set gas prices from a compact block #1636

Closed
turbocrime opened this issue Aug 3, 2024 · 2 comments · Fixed by #1637
Closed

Block processor fails to set gas prices from a compact block #1636

turbocrime opened this issue Aug 3, 2024 · 2 comments · Fixed by #1637
Assignees
Labels
bug Something isn't working idb idb access, schema, or interface priority Important to work on next sync

Comments

@turbocrime
Copy link
Contributor

turbocrime commented Aug 3, 2024

if (compactBlock.gasPrices) {
await this.indexedDb.saveGasPrices(
new GasPrices({
assetId: this.stakingAssetId,
...compactBlock.gasPrices,
}),
);
}

When the assetId in compactBlock.gasPrices is set to undefined (not absent, but a present value of undefined), spreading it after attaching an assetId to the object will clobber the assetId which was just set.

But, the idb table requires an asset id for the keypath. So this setGasPrices call will throw an error and prevent sync from progressing.

Screenshot 2024-08-02 at 17 14 06

I believe this is at the root of some of the 'long sync time' issues reported by users.

@turbocrime turbocrime added bug Something isn't working priority Important to work on next sync labels Aug 3, 2024
@turbocrime turbocrime self-assigned this Aug 3, 2024
@grod220
Copy link
Collaborator

grod220 commented Aug 3, 2024

Yep worth adjusting the logic. However, no user should be encountering this as all blocks that contain new gas prices have included an assetId.

Edit: Correction, some include assetId and some exclude it. But none explicitly have undefined set as that field (which feels like is consistent with the Typescript type given by bufbuild for the type).

@turbocrime turbocrime added the idb idb access, schema, or interface label Aug 3, 2024
@TalDerei
Copy link
Contributor

TalDerei commented Aug 8, 2024

still unclear if this can be closed

@grod220 grod220 closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working idb idb access, schema, or interface priority Important to work on next sync
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants