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

[digital-carbon] Handle potential sync breakages #178

Open
wants to merge 3 commits into
base: staging
Choose a base branch
from

Conversation

psparacino
Copy link
Collaborator

@psparacino psparacino commented Aug 2, 2024

Potential sync issues addressed:

Unsupported registries:

In the past, tokens from the c3 factory have occasionally had registry values not in the Registry enum, which have broken the subgraph sync.

This PR adds a fallback in case c3 issues credits for registries not in the registry enum so there is no break in production. A Debug entity is created when an unsupported registry so the problem can be further assessed and a fix deployed.

handle null values from loadRetire:

loadRetire should never come back null either in practice or by design (therefore it does not follow the load/create pattern). However if a retire comes does back null from this function it will break the sync, as the subgraph will attempt to access a property on null.

This issue has never come up afaik. In the rare event it does this will return before the subgraph attempts to access the property and create a Debug entity.

@psparacino psparacino marked this pull request as draft August 27, 2024 15:47
@psparacino psparacino force-pushed the pdc/unsupported-registry branch from 1181946 to 7d43897 Compare September 26, 2024 15:07
@psparacino psparacino changed the title [digital-carbon] Add UNSUPPORTED_REGISTRY as c3 fallback [digital-carbon] Handle potential sync breakages Sep 26, 2024
@psparacino psparacino marked this pull request as ready for review September 26, 2024 16:02
Copy link
Collaborator

@0xAurelius 0xAurelius left a comment

Choose a reason for hiding this comment

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

Isn't adding this entity to production subgraphs going to blow up our entity count?

Or is the logic only going to create one of these when there is an issue with a retirement?

@psparacino
Copy link
Collaborator Author

Isn't adding this entity to production subgraphs going to blow up our entity count?

Or is the logic only going to create one of these when there is an issue with a retirement?

Right; it only creates the Debug entity when an underlying retire isn't found in the RA handleCarbonRetired event (which afaik has never happened) or when there is an unsupported registry (which is rare).

@psparacino psparacino force-pushed the pdc/unsupported-registry branch from b7d5c5e to c2371d6 Compare November 21, 2024 17:40
@psparacino psparacino changed the base branch from main to staging November 21, 2024 17:40
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