-
Notifications
You must be signed in to change notification settings - Fork 197
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
Extra data in block structure api and indexer #4308
Conversation
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.
@@ Log scanner @@
indexer-extra-data-block-structure
================================================================================
- Known Warnings 18
- New Warnings 0
- Known Errors 0
- New Errors 3
- Panics 26
================================================================================
Codecov Report
@@ Coverage Diff @@
## rc/2022-july #4308 +/- ##
===============================================
Coverage ? 73.69%
===============================================
Files ? 663
Lines ? 86191
Branches ? 0
===============================================
Hits ? 63515
Misses ? 17914
Partials ? 4762 Continue to review full report at Codecov.
|
node/external/blockAPI/metaBlock.go
Outdated
} | ||
|
||
epochStartShardsData := metaBlock.EpochStart.LastFinalizedHeaders | ||
apiBlock.EpochStartShardsData = make([]*api.EpochStartShardData, 0, len(metaBlock.EpochStart.LastFinalizedHeaders)) |
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.
could have used len(epochStartShardsData)
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.
done.
node/external/blockAPI/baseBlock.go
Outdated
|
||
func addScheduledInfoInBlock(header data.HeaderHandler, apiBlock *api.Block) { | ||
additionalData := header.GetAdditionalData() | ||
if additionalData == nil { |
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.
check.IfNil(additionalData)
as header.GetAdditionalData()
will return an interface
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.
done.
} | ||
} | ||
|
||
func bigIntToStr(value *big.Int) string { |
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.
unit tests
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.
added
return apiMetaBlock, nil | ||
} | ||
|
||
func addStartOfEpochInfoInBlock(metaBlock *block.MetaBlock, apiBlock *api.Block) { |
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.
👍
node/external/blockAPI/metaBlock.go
Outdated
} | ||
|
||
if len(epochStartShardData.PendingMiniBlockHeaders) == 0 { | ||
apiBlock.EpochStartShardsData = append(apiBlock.EpochStartShardsData, shardData) |
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.
move this outside the if branch and remove L222
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.
done.
@@ -418,7 +418,26 @@ func TestMetaAPIBlockProcessor_GetBlockByRound_GetBlockByNonce_EpochStartBlock(t | |||
}, | |||
}, | |||
EpochStart: block.EpochStart{ | |||
LastFinalizedHeaders: []block.EpochStartShardData{{}}, | |||
LastFinalizedHeaders: []block.EpochStartShardData{{ |
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.
Please do:
- add one more finalized header
- add one more miniblock header in each finalized header
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.
done.
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.
@@ Log scanner @@
indexer-extra-data-block-structure
================================================================================
- Known Warnings 14
- New Warnings 0
- Known Errors 0
- New Errors 0
- Panics 0
================================================================================
block
structure)