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

Fetch start of epoch metablock #3856

Merged
merged 7 commits into from
Mar 2, 2022

Conversation

ssd04
Copy link
Contributor

@ssd04 ssd04 commented Mar 1, 2022

Implement separate endpoint for fetching start of epoch metablock by specifying the epoch.

@ssd04 ssd04 self-assigned this Mar 1, 2022
@ssd04 ssd04 marked this pull request as ready for review March 1, 2022 09:09
@bogdan-rosianu bogdan-rosianu self-requested a review March 1, 2022 09:14
@iulianpascalau iulianpascalau self-requested a review March 1, 2022 10:19
@@ -153,6 +153,23 @@ func (ibp *internalBlockProcessor) GetInternalMetaBlockByRound(format common.Api
return ibp.convertMetaBlockBytesByOutputFormat(format, blockBytes)
}

// GetInternalStartOfEpochMetaBlock wil return a meta block by hash
Copy link
Contributor

Choose a reason for hiding this comment

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

// GetInternalStartOfEpochMetaBlock wil return the epoch start meta block for the provided epoch

Copy link
Contributor

Choose a reason for hiding this comment

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

also, can you add unit tests for this function ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added unit tests

@@ -161,6 +161,12 @@ func (nar *nodeApiResolver) GetInternalMetaBlockByRound(format common.ApiOutputF
return nar.apiInternalBlockHandler.GetInternalMetaBlockByRound(format, round)
}

// GetInternalStartOfEpochMetaBlock wil return start of epoch meta block
Copy link
Contributor

Choose a reason for hiding this comment

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

// GetInternalStartOfEpochMetaBlock will return the start of epoch meta block for the provided epoch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

iulianpascalau
iulianpascalau previously approved these changes Mar 1, 2022
}

start := time.Now()
block, err := ib.getFacade().GetInternalStartOfEpochMetaBlock(common.ApiOutputFormatInternal, epoch)
Copy link
Contributor

Choose a reason for hiding this comment

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

so we have

common.ApiOutputFormatInternal
common.ApiOutputFormatProto

Can we rename ApiOutputFormatInternal to something else? It took me several minutes to figure out which is returning what. InternalMarshalizer is the GogoProtoMarshalizer. I thought they were the same.

Can be done in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do in a separate PR 👍

@ssd04 ssd04 merged commit eefbef5 into feat/header-verification Mar 2, 2022
@ssd04 ssd04 deleted the fetch-start-of-epoch-metablock branch March 2, 2022 08:27
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.

None yet

3 participants