Conversation
9ea2892 to
9b8a427
Compare
9b8a427 to
79b708a
Compare
❌ Preprod Tests: FAILEDTests run against preprod network with live blockchain data |
❌ Preprod Tests: FAILEDTests run against preprod network with live blockchain data |
|
|
||
| public static ApiException missingDRepId() { | ||
| return new ApiException(RosettaErrorType.MISSING_DREP_ID.toRosettaError(false)); | ||
| return new ApiException(RosettaErrorType.MISSING_DREP_ID.toRosettaError(false), HttpStatus.BAD_REQUEST); |
There was a problem hiding this comment.
Even though it is not correct and not according to REST API, I believe we actually HAVE to do HTTP 500 in Rosetta on various errors. The whole Rosetta works like this now. I would not change this or if we can change this, we have to change this on all errors.
It would be best if you check if I am right according to Rosetta specification but that will be a separate refactoring task.
There was a problem hiding this comment.
You're right! There is no 400 response defined anywhere in the spec. Every endpoint in our local api.yaml follows this same pattern. only 200 and 500, no 4xx codes at all.
matiwinnetou
left a comment
There was a problem hiding this comment.
Let's keep HTTP 500 error even though is incorrect according to REST specs.
✅ Preprod Tests: PASSEDTests run against preprod network with live blockchain data |
Summary
drep.typefrom CIP-129 header byte (0x22= key_hash,0x23= script_hash) when omitted in/construction/preprocessand/construction/payloadstypeand CIP-129 prefixedidare provided (existing behavior preserved)drep.typerequired for raw 28-byte ids and for abstain/no_confidence typesMotivation
CIP-129 compliant hex identifiers encode the credential type in their header byte. Requiring clients to redundantly specify
drep.typewhen the information is already embedded in thedrep.idcreates unnecessary friction.References:
Changes
OpenAPI Spec
api.yaml— Removedtypefromrequiredlist inDRepParamsschema. Updated descriptions to document CIP-129 inference behavior.Core Logic
ProcessConstructions.java— AddedinferDrepTypeFromCip129Header()method:drep.idhex0x2_)0x22→KEY_HASH,0x23→SCRIPT_HASHdrep.typeisnull; sets type onDRepParamsbefore normal processingBehavior Matrix
drep.idformatdrep.type0x22)key_hash, proceeds normally0x23)script_hash, proceeds normally0x22)key_hash0x22)script_hash0x12)key_hashabstainidnot requiredno_confidenceidnot requiredBackward Compatibility
This change is fully backward-compatible:
drep.typecontinue to work identicallytypewith CIP-129 prefixed id)Test Plan
/construction/preprocesswith CIP-129 prefixeddrep.idand notype