Skip to content

Conversation

@Cmdv
Copy link
Contributor

@Cmdv Cmdv commented Oct 15, 2025

This PR implements graceful handling of off-chain voting anchor metadata based on parsing success.
fixes #1995
When the anchor hash matches, data is stored with an is_valid flag indicating:

  • TRUE: Valid JSON conforming to CIP-100 → all related tables populated
  • FALSE: Valid JSON not conforming to CIP-100 → JSON stored, related tables empty
  • NULL: Invalid JSON → error message in json column, raw bytes preserved

Hash mismatches continue to go to the error table for retry. Tests and documentation updated accordingly.

@Cmdv Cmdv requested a review from a team as a code owner October 15, 2025 12:27
@Cmdv Cmdv force-pushed the 1995-offchain-voting-json branch 3 times, most recently from 7c299d2 to f6f66ee Compare October 15, 2025 12:43
Copy link
Contributor

@kderme kderme left a comment

Choose a reason for hiding this comment

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

Just a small code reduction

@Cmdv Cmdv force-pushed the 1995-offchain-voting-json branch from f6f66ee to f24d86a Compare November 26, 2025 15:00
@Cmdv Cmdv requested a review from a team as a code owner November 26, 2025 15:00
@Cmdv Cmdv force-pushed the 1995-offchain-voting-json branch 6 times, most recently from 0c34e87 to 7cfd660 Compare November 28, 2025 16:48
@rdlrt
Copy link
Contributor

rdlrt commented Nov 28, 2025

  • FALSE: Valid JSON not conforming to CIP-100 → JSON stored, related tables empty

Wasnt the issue about storing data if hash matches regardless of whether it conforms to a standard or not (as there will be multiple standards) leaving conformance to consumers?

This does not sound like it is exactly addressing the request

@kderme
Copy link
Contributor

kderme commented Dec 1, 2025

  • FALSE: Valid JSON not conforming to CIP-100 → JSON stored, related tables empty

Wasnt the issue about storing data if hash matches regardless of whether it conforms to a standard or not (as there will be multiple standards) leaving conformance to consumers?

This does not sound like it is exactly addressing the request

Note that we already store bytes in off_chain_vote_data.bytes for metadata. You can get the original text using

select convert_from(bytes, 'utf-8') from off_chain_vote_data limit 1;

After this pr this is always included as long as the bytes hash match the expected (and the http header is reasonable)

@rdlrt
Copy link
Contributor

rdlrt commented Dec 1, 2025

  • FALSE: Valid JSON not conforming to CIP-100 → JSON stored, related tables empty

Wasnt the issue about storing data if hash matches regardless of whether it conforms to a standard or not (as there will be multiple standards) leaving conformance to consumers?
This does not sound like it is exactly addressing the request

Note that we already store bytes in off_chain_vote_data.bytes for metadata. You can get the original text using

select convert_from(bytes, 'utf-8') from off_chain_vote_data limit 1;

After this pr this is always included as long as the bytes hash match the expected (and the http header is reasonable)

It is only stored if metadata returned is considered valid/parsable (atleast before), glad if that's changing now

@kderme
Copy link
Contributor

kderme commented Dec 1, 2025

After this pr this is always included as long as the bytes hash match the expected (and the http header is reasonable)

It is only stored if metadata returned is considered valid/parsable (atleast before), glad if that's changing now

This changes with this pr. The offchain and the byte will exist even if the json parsing fails. A separate field will annotate that parsing failed

Cmdv and others added 6 commits December 2, 2025 09:54
In it's current state, we're unable to build cardana-chain-gen:

    cannot find -lpgcommon: No such file or directory
    cannot find -lpgport: No such file or directory
    collect2: error: ld returned 1 exit status

Remove the extra configure flags, and see if we can still build all the
other artifacts.
@Cmdv Cmdv force-pushed the 1995-offchain-voting-json branch from 421ff32 to 19a7e04 Compare December 2, 2025 09:55
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.

Error Offchain Voting Anchor: JSON decode error

5 participants