Skip to content

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
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-behjati ali-behjati 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-behjati ali-behjati 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.

3 participants