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

fix: 🐛 update spam handling to avoid inconsistencies after runtime upgrades #338

Merged
merged 6 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions api-augment/dist/interfaces/lookup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions api-augment/dist/types/interfaces/augment-api-query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1372,11 +1372,13 @@ declare module "@polkadot/api-base/types/storage" {
lastDeletedTick: AugmentedQuery<ApiType, () => Observable<u32>, []> &
QueryableStorageEntry<ApiType, []>;
/**
* The number of blocks that have been considered _not_ full in the last [`Config::BlockFullnessPeriod`].
* The vector holding whether the last [`Config::BlockFullnessPeriod`] blocks were full or not.
*
* This is used to check if the network is presumably under a spam attack.
* Each element in the vector represents a block, and is `true` if the block was full, and `false` if it was not.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Each element in the vector represents a block, and is `true` if the block was full, and `false` if it was not.
* Each element in the vector represents a block, and is `true` if the block was full, and `false` otherwise.

* Note: Ideally we would use a `BitVec` to reduce storage, but since there's no bounded `BitVec` implementation
* we use a BoundedVec<bool> instead. This uses 7 more bits of storage per element.
**/
notFullBlocksCount: AugmentedQuery<ApiType, () => Observable<u32>, []> &
pastBlocksStatus: AugmentedQuery<ApiType, () => Observable<Vec<bool>>, []> &
QueryableStorageEntry<ApiType, []>;
/**
* A mapping from block number to the weight used in that block.
Expand Down
Loading
Loading