Skip to content

[digital-carbon] Handle potential sync breakages#178

Open
psparacino wants to merge 3 commits into
stagingfrom
pdc/unsupported-registry
Open

[digital-carbon] Handle potential sync breakages#178
psparacino wants to merge 3 commits into
stagingfrom
pdc/unsupported-registry

Conversation

@psparacino
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
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).

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