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

Conversation

s0me0ne-unkn0wn
Copy link
Contributor

Quoting @bkchr (from here):

That the hardcoded limit is used there again, is IMO not correct. The max_pov_size should be controlled by the HostConfiguration and not limited by some "random" constant.

This PR aims to change the hard limit to a not-so-random constant, allowing more room for maneuvering in the future.

@dmitry-markin
Copy link
Contributor

Should we account for some encoding overhead?

@s0me0ne-unkn0wn
Copy link
Contributor Author

Should we account for some encoding overhead?

In theory, yes, but in practice, it doesn't make sense. This limit was supposed to be a compressed PoV limit, that is, exactly what is transferred through the network. But indeed, as we don't know how much it will compress while building a block, we use it as an uncompressed PoV limit, so after the compression, it always comes out smaller with a good reserve.

@@ -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)

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Yeah not super happy with this, mainly the same arguments as discussed here already. But yeah, better than what we have right now.

@s0me0ne-unkn0wn s0me0ne-unkn0wn added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Oct 2, 2024
@s0me0ne-unkn0wn s0me0ne-unkn0wn added this pull request to the merge queue Oct 2, 2024
Merged via the queue into master with commit 087ea03 Oct 2, 2024
217 checks passed
@s0me0ne-unkn0wn s0me0ne-unkn0wn deleted the s0me0ne/max-pov-size-limit-check branch October 2, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants