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

Packet Maturity Time Mapping in the consumer chain is redundant. Storing time/id -> {time, id} #721

Closed
AdityaSripal opened this issue Feb 7, 2023 · 1 comment
Labels
source: audit To indicate an issue found during an audit. type: feature-request New feature or request improvement

Comments

@AdityaSripal
Copy link
Member

All of the information stored in the value is recoverable from the key itself, so there is redundant information being stored. We could just store a sentinel byte value and still have the same information in the store.

func (k Keeper) SetPacketMaturityTime(ctx sdk.Context, vscId uint64, maturityTime time.Time) {

@AdityaSripal AdityaSripal added type: feature-request New feature or request improvement source: audit To indicate an issue found during an audit. labels Feb 7, 2023
@mpoke
Copy link
Contributor

mpoke commented Feb 23, 2023

@AdityaSripal We want to move away from the pattern of parsing keys to retrieve data as it was a source of bugs in the past. The new pattern should be key -> value, where the key is a unique string and the value is a protobuf that contains all the necessary data.

In this particular case, the key is never needed as the packet maturity time mapping is only used in an iterator.

@mpoke mpoke closed this as completed Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: audit To indicate an issue found during an audit. type: feature-request New feature or request improvement
Projects
None yet
Development

No branches or pull requests

2 participants