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

Do not enforce PoV size hard limit in config #5887

Merged
merged 7 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions polkadot/runtime/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ serde = { features = ["alloc", "derive"], workspace = true }
derive_more = { workspace = true, default-features = true }
bitflags = { workspace = true }

sc-network = { workspace = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a really heavy dependency to bring into the runtime just for this constant, not sure if the compiler is smart enough to saves us all the troubles we might have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any better ideas? Since #5753 we have a dedicated constant for PoV response size, but it is also situated in a location we wouldn't want to import. Maybe we should move that constant somewhere but I'm struggling to find a good place for it. polkadot-parachain-primitives is perfect, as it relates to parachains and is shared between the node and the runtime, but it seems to me it's strange to have a network-related constant there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, this is low level networking, doesn't make sense for the runtime to depend on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any better ideas?

an alternative is in comment #5887 (comment)


sp-api = { workspace = true }
sp-inherents = { workspace = true }
sp-io = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/parachains/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use polkadot_primitives::{
ApprovalVotingParams, AsyncBackingParams, Balance, ExecutorParamError, ExecutorParams,
NodeFeatures, SessionIndex, LEGACY_MIN_BACKING_VOTES, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE,
MAX_POV_SIZE, ON_DEMAND_MAX_QUEUE_MAX_SIZE,

Check failure on line 32 in polkadot/runtime/parachains/src/configuration.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

unused import: `MAX_POV_SIZE`
};
use sp_runtime::{traits::Zero, Perbill, Percent};

Expand Down Expand Up @@ -377,7 +377,7 @@
})
}

if self.max_pov_size > MAX_POV_SIZE {
s0me0ne-unkn0wn marked this conversation as resolved.
Show resolved Hide resolved
if self.max_pov_size as u64 > sc_network::MAX_RESPONSE_SIZE {
s0me0ne-unkn0wn marked this conversation as resolved.
Show resolved Hide resolved
return Err(MaxPovSizeExceedHardLimit { max_pov_size: self.max_pov_size })
}

Expand Down
Loading