-
Notifications
You must be signed in to change notification settings - Fork 10
Blobs Fees Adjustments #149
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
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
@@ -5,6 +5,9 @@ use sp_runtime::{ | |||
MultiSignature, | |||
}; | |||
|
|||
// TODO: probably this could be moved into runtimes/kusama-runtime/src/constants.rs | |||
pub const MAXIMUM_BLOCK_LENGTH: u32 = 5 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs docs (btw, this is 5* 1024 * 1024 because it's the maximum allowed PoV size).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, RuntimeBlockLength
was defined like this:
pub const RuntimeBlockLength: BlockLength = BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
I decided to make the value a constant because I needed it inside the BlobsLengthToFee
logic. I will add docs to describe what the constant represents.
I'm not sure why 5 * 1024 * 1024
was used as the maximum block size. I have an idea, but I'm not entirely sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What size is used in Substrate as the default maximum block size? I am 80% sure it's 4 MiB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both in substrate node template and cumulus node template is used 5 * 1024 * 1024 as BlockLength
5057469
to
844bbb2
Compare
844bbb2
to
810e3dc
Compare
810e3dc
to
5a4b0f1
Compare
sugondat-chain/runtimes/sugondat-kusama/tests/integration_test.rs
Outdated
Show resolved
Hide resolved
5a4b0f1
to
a9f23fb
Compare
a9f23fb
to
fc214f7
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This PR contains an implementation of the following formula for fees:
This is accomplished by using
LengthToFee
dynamically along withFeeMultiplierUpdate
.Decoupling
length_fee
andweight_fee
could be the perfect solution to handle both blockchain usage congestion and blocks usage.In #16, I explain how difficult it is to find a relationship between those two. The main difference is that each
submit_blob
extrinsic has a weight even with a blob of zero size.Having two adjustment factors can handle every scenario. Some extreme ones are:
targeted_length_fee_adjustment
andtargeted_weight_fee_adjustment
will decreasetargeted_length_fee_adjustment
will increase whiletargeted_weight_fee_adjustment
won't, because the blob size has a minimal impact on thesubmit_blob
weighttargeted_length_fee_adjustment
won't increase. However, with many transactions, weight has a huge impact, makingtargeted_weight_fee_adjustment
the key to handling chain congestion.TODOs