Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
migrations: finalize migration_5 (share encoding GOB -> SSZ) #2002
migrations: finalize migration_5 (share encoding GOB -> SSZ) #2002
Changes from all commits
eb5b7d7
2c6d7e6
8a8d873
ec5df5c
5259c9e
a8258fa
ba4b807
fdeb284
da77d0c
7bdae58
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 62 in migrations/migration_5_gob.go
Codecov / codecov/patch
migrations/migration_5_gob.go#L62
Check warning on line 78 in migrations/migration_5_gob.go
Codecov / codecov/patch
migrations/migration_5_gob.go#L78
Check warning on line 94 in migrations/migration_5_gob.go
Codecov / codecov/patch
migrations/migration_5_gob.go#L92-L94
Check warning on line 97 in migrations/migration_5_gob.go
Codecov / codecov/patch
migrations/migration_5_gob.go#L97
Check warning on line 26 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L20-L26
Check warning on line 32 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L28-L32
Check warning on line 41 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L41
Check warning on line 44 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L43-L44
Check warning on line 54 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L49-L54
Check warning on line 56 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L56
Check warning on line 59 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L58-L59
Check warning on line 64 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L64
Check warning on line 77 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L74-L77
Check warning on line 80 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L79-L80
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.
as per @moshe-blox recommendation I found
litter
to be super useful for debugging, what do you think of using it like that (for printing detailed error message) ?Alternatively we could use
logger
to print the contents ofshareGOB
andshareSSZ
, but since we also have to returnerror
that means we essentially have to duplicate error message (and it will be logged twice)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.
It seems to have pretty good score, although, would it be enough to just use the logger? I assume the challenge is that zap logger does not log pointer objects with its full properties if to use something like
zap.Any(shareGOB)
?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.
I think
zap
logger should produce full object printout withzap.Any
(although it will probably struggle if struct contains interfaces - #1981),the main reason I don't want to use logger here is that we'll essentially be logging this
GOB share doesn't match corresponding SSZ share, GOB: ...
error twice:and only one of these logged lines will contain full contents of
shareGOB
andshareSSZ
printed out (which is even more confusing - could look like 2 separate/different errors unless you look super carefully)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.
I see.
I’m just slightly hesitant about adding a new dependency and increasing the binary size, especially since it’s only used in one place within the DB migration, which clients would run just once. Although, if @moshe-blox thinks it's OK, then I do not mind
Check warning on line 112 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L85-L112
Check warning on line 116 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L114-L116
Check warning on line 121 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L118-L121
Check warning on line 128 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L127-L128
Check warning on line 149 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L131-L149
Check warning on line 165 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L151-L165
Check warning on line 172 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L167-L172
Check warning on line 184 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L175-L184
Check warning on line 186 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L186
Check warning on line 190 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L188-L190
Check warning on line 197 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L192-L197
Check warning on line 199 in migrations/migration_5_share_gob_to_ssz.go
Codecov / codecov/patch
migrations/migration_5_share_gob_to_ssz.go#L199