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

feat: use kvstore to fetch gas per blob byte #1095

Merged
merged 8 commits into from
Dec 21, 2022

Conversation

rahulghangas
Copy link
Contributor

@rahulghangas rahulghangas commented Dec 8, 2022

Replaces gas per blob byte constant with stored param

-- Note - To be merged after #1031

x/blob/keeper/keeper.go Outdated Show resolved Hide resolved
@evan-forbes
Copy link
Member

nice! what's left for this? is this blocked by anything?

x/blob/types/params.go Outdated Show resolved Hide resolved
@evan-forbes evan-forbes added this to the Incentivized Testnet milestone Dec 15, 2022
@rahulghangas rahulghangas self-assigned this Dec 20, 2022
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

great work! thanks for adding the really good tests!!

@rahulghangas rahulghangas merged commit d24af41 into celestiaorg:main Dec 21, 2022
@rahulghangas rahulghangas deleted the feat/use-kvstore-params branch December 21, 2022 16:08
},
{
name: "1024 byte blob", // occupies 3 shares because share prefix (e.g. namespace, info byte)
msg: types.MsgPayForBlob{BlobSize: 1024},
wantGasConsumed: uint64(12288), // 3 shares * 512 bytes per share * 8 gas per byte = 12288 gas
wantGasConsumed: uint64(13348), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 12288 gas
Copy link
Collaborator

Choose a reason for hiding this comment

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

the sum wasn't updated in the comment

			wantGasConsumed: uint64(13348), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas

Comment on lines +55 to +56
// calculate gas per message share by fetching the constant share size and the gas cost per byte from the KV store
gasPerMsgShare := appconsts.ShareSize * k.GasPerBlobByte(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[proposal]
message => blob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace GasPerBlobByte const with stored param
4 participants