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

add function to combine accumulator update #40

Merged
merged 7 commits into from
Sep 6, 2023

Conversation

cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Sep 3, 2023

add function to combine accumulator updates by:

  1. iterate through the list of update_data and check their vaa
  2. for those with the same vaa, combine them into one accumulator update by incrementing the number of updates in the first update_data and appending the update to updates
  3. for those with different vaa, keep them
  4. serialize them back to the accumulator update_data format

@cctdaniel cctdaniel marked this pull request as draft September 3, 2023 13:14
@cctdaniel cctdaniel marked this pull request as ready for review September 5, 2023 06:22
@@ -112,6 +115,54 @@ def to_dict(self, verbose=False, vaa_format=DEFAULT_VAA_ENCODING):
return result


class MerkleUpdate:
Copy link
Contributor Author

@cctdaniel cctdaniel Sep 5, 2023

Choose a reason for hiding this comment

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

this name is based on the Accumulator Wire Format document on Notion

Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

It is very nice! i think there are some duplicate codes that we can remove. I like to review again after you removed them.

Copy link
Contributor

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

Very nice!

@cctdaniel cctdaniel merged commit 514dfab into main Sep 6, 2023
@cctdaniel cctdaniel deleted the price-feeds-combine-accumulator-update branch September 6, 2023 00:24
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.

2 participants