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

Remove deprecated ModuleCdc amino encoding from name module #189

Closed
3 of 6 tasks
iramiller opened this issue Mar 22, 2021 · 0 comments · Fixed by #211
Closed
3 of 6 tasks

Remove deprecated ModuleCdc amino encoding from name module #189

iramiller opened this issue Mar 22, 2021 · 0 comments · Fixed by #211
Assignees
Labels
bug Something isn't working name Name Module
Milestone

Comments

@iramiller
Copy link
Member

iramiller commented Mar 22, 2021

Summary of Bug

The name module is currently using ModuleCdc (Amino) encoding for storage in the KV store. This use is deprecated in favor of the Binary Marshaller (proto) format.

Mitigation

  • Refactor Marshall/Unmarshall methods to use the cdc binary encoder
x/name/keeper/keeper.go:
   90  	}
   91: 	bz, err := types.ModuleCdc.MarshalBinaryBare(&record)
   92  	if err != nil {

  117  	record = &types.NameRecord{}
  118: 	err = types.ModuleCdc.UnmarshalBinaryBare(bz, record)
  119  	return record, err

  193  		record := types.NameRecord{}
  194: 		if err := types.ModuleCdc.UnmarshalBinaryBare(iterator.Value(), &record); err != nil {
  195  			return err
  • Create a migration function that extracts any existing name records encoded in amino and reloads them using proto encoding.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@iramiller iramiller added bug Something isn't working name Name Module labels Mar 22, 2021
@iramiller iramiller added this to the 1.0.0 milestone Mar 22, 2021
@iramiller iramiller changed the title Replaced deprecated ModuleCdc (Amino) encoding use in Name module Remove deprecated ModuleCdc (Amino) encoding use in Name module Mar 22, 2021
@iramiller iramiller changed the title Remove deprecated ModuleCdc (Amino) encoding use in Name module Remove deprecated ModuleCdc amino encoding from name module Mar 22, 2021
@arnabmitra arnabmitra self-assigned this Mar 25, 2021
@iramiller iramiller moved this from Todo to Done in Provenance Core Protocol Team Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working name Name Module
Projects
Development

Successfully merging a pull request may close this issue.

2 participants