Skip to main content
For the complete documentation index, see llms.txt

Decode 1010 transaction rejection errors

1010 Invalid Transaction 응답이 발생했을 때, 내부의 Custom error: N 값을 Midnight 원장 오류 변형(variant)으로 디코딩하여 문제를 해결하세요.

Understand the cause of the error

Midnight 노드에 트랜잭션을 제출하면 JSON-RPC 계층이 다음과 같이 코드 1010으로 거부할 수 있습니다.

{
"code": 1010,
"message": "Invalid Transaction",
"data": "Custom error: 155"
}

코드 1010 자체는 Substrate의 외피이며, Midnight 고유의 오류가 아닙니다. 노드의 트랜잭션 풀이 extrinsic을 거부했음을 알리는 신호일 뿐입니다. 실제로 의미 있는 정보는 Custom error: NN 값으로, 이는 Midnight 노드가 정의한 LedgerApiError 변형에 대응하는 u8(0–255) 값입니다.

Two layers, one error

1010은 Substrate에서 상속된 코드이고, 내부의 u8이 Midnight의 코드입니다. 문제를 진단하려면 이 u8 값을 디코딩해야 합니다.

Extract the inner u8

내부 u8 값은 RPC 오류 응답의 data 필드 안에 들어 있습니다. 일반적인 클라이언트 환경에서 이 값을 추출하는 방법은 아래 단계를 참고하세요.

1

Capture the full RPC response

메시지 문자열만이 아니라 전체 오류 응답을 그대로 받아야 합니다. 많은 지갑 라이브러리와 CLI 래퍼는 기본적으로 data 필드를 잘라냅니다.

try {
await api.tx.someCall().signAndSend(account);
} catch (err) {
console.error(JSON.stringify(err, null, 2));
}
2

Read the trailing integer in the data field

data 필드는 Custom error: N 형태로 끝나며, 여기서 N이 변형 코드입니다.

"data": "Custom error: 155"

이 예시에서 N155입니다.

3

Look up the variant

아래의 variant 테이블에서 u8 값을 찾아 해당하는 원장 오류 이름과 분류를 확인하세요.

Variant codes change between releases

변형 번호는 Midnight 노드에서 정의하며 릴리스마다 달라질 수 있습니다. 예를 들어 168 FeeCalculation은 폐기되어 155 FeeCalculationError로 대체되었습니다. 사용 중인 네트워크의 노드 버전에 맞는 릴리스 노트를 항상 함께 확인하세요.

Look up the variant

아래 표에는 Midnight 노드에서 발생하는 모든 LedgerApiError 변형을 분류별로 정리해 두었습니다. 각 행은 u8 값, 변형 이름, 의미를 보여줍니다. 이전 단계에서 추출한 Custom error: N 값과 일치하는 행을 찾으세요.

Deserialization errors (0–11)

노드가 직렬화된 입력을 디코딩하지 못한 경우입니다. 이 단계에서 거부된 트랜잭션은 어떤 원장 로직에도 도달하지 않습니다.

Show full table
CodeVariant
0NetworkId
1Transaction
2LedgerState
3ContractAddress
4PublicKey
5VersionedArenaKey
6UserAddress
7TypedArenaKey
8SystemTransaction
9DustPublicKey
10CNightGeneratesDustActionType
11CNightGeneratesDustEvent

Serialization errors (50–63)

노드가 값을 직렬화 형식으로 인코딩하지 못한 경우입니다. 이러한 오류는 일반적으로 클라이언트 문제가 아니라 내부 정합성 문제를 의미합니다.

Show full table
CodeVariant
50TransactionIdentifier
51LedgerState
52LedgerParameters
53ContractAddress
54ContractState
55ContractStateToJson
56ZswapState
57UnknownType
58MerkleTreeDigest
59VersionedArenaKey
60TypedArenaKey
61CNightGeneratesDustEvent
62SystemTransaction
63ArenaHash

Invalid transactions (100–109, 193–200, 239–250)

트랜잭션 자체의 구조에는 문제가 없지만, 현재 원장 상태와 충돌하는 경우입니다. 운영 트래픽에서 가장 흔하게 발생하는 거부 사유입니다.

Show full table
CodeVariant
100EffectsMismatch
101ContractAlreadyDeployed
102ContractNotPresent
103Zswap
104Transcript
105InsufficientClaimable
106VerifierKeyNotFound
107VerifierKeyAlreadyPresent
108ReplayCounterMismatch
109UnknownError
193ReplayProtectionViolation (Retired)
194BalanceCheckOutOfBounds
195InputNotInUtxos
196DustDoubleSpend
197DustDeregistrationNotRegistered
198GenerationInfoAlreadyPresent
199InvariantViolation
200RewardTooSmall
239Zswap.Invalid.NullifierAlreadyPresent
240Zswap.Invalid.CommitmentAlreadyPresent
241Zswap.Invalid.UnknownMerkleRoot
242ReplayProtectionViolation.IntentTtlExpired
243ReplayProtectionViolation.IntentTtlTooFarInFuture
244ReplayProtectionViolation.IntentAlreadyExists
248DivideByZero
249Invalid.MerkleTreeError
250Zswap.Invalid.MerkleTreeError

Malformed transactions (110–139, 166–192, 212–238)

트랜잭션이 구조 검증이나 암호 검증을 통과하지 못한 경우입니다. 제출 측 클라이언트는 이러한 오류를 트랜잭션 생성 또는 서명 과정의 버그로 간주해야 합니다.

Show full table
CodeVariant
110VerifierKeyNotSet
111TransactionTooLarge
112VerifierKeyTooLarge
113VerifierKeyNotPresent
114ContractNotPresent
115InvalidProof
116BindingCommitmentOpeningInvalid
117NotNormalized
118FallibleWithoutCheckpoint
119ClaimReceiveFailed
120ClaimSpendFailed
121ClaimNullifierFailed
122ClaimCallFailed
123InvalidSchnorrProof
124UnclaimedCoinCom
125UnclaimedNullifier
126Unbalanced
127Zswap
128BuiltinDecode
129GuaranteedLimit
130MergingContracts
131CantMergeTypes
132ClaimOverflow
133ClaimCoinMismatch
134KeyNotInCommittee
135InvalidCommitteeSignature
136ThresholdMissed
137TooManyZswapEntries
138BalanceCheckOverspend
139UnknownError
166InvalidNetworkId
167IllegallyDeclaredGuaranteed
168FeeCalculation (Retired)
169InvalidDustRegistrationSignature
170InvalidDustSpendProof
171OutOfDustValidityWindow
172MultipleDustRegistrationsForKey
173InsufficientDustForRegistrationFee
174MalformedContractDeploy
175IntentSignatureVerificationFailure
176IntentSignatureKeyMismatch
177IntentSegmentIdCollision
178IntentAtGuaranteedSegmentId
179UnsupportedProofVersion
180GuaranteedTranscriptVersion
181FallibleTranscriptVersion
182TransactionApplicationError (Retired)
183BalanceCheckOutOfBounds
184BalanceCheckConversionFailure
185PedersenCheckFailure
186EffectsCheckFailure (Retired)
187DisjointCheckFailure (Retired)
188SequencingCheckFailure (Retired)
189InputsNotSorted
190OutputsNotSorted
191DuplicateInputs
192InputsSignaturesLengthMismatch
212EffectsCheck.RealCallsSubsetCheckFailure
213EffectsCheck.AllCommitmentsSubsetCheckFailure
214EffectsCheck.RealUnshieldedSpendsSubsetCheckFailure
215EffectsCheck.ClaimedUnshieldedSpendsUniquenessFailure
216EffectsCheck.ClaimedCallsUniquenessFailure
217EffectsCheck.NullifiersNeqClaimedNullifiers
218EffectsCheck.CommitmentsNeqClaimedShieldedReceives
219SequencingCheck.CallSequencingViolation
220SequencingCheck.SequencingCorrelationViolation
221SequencingCheck.GuaranteedInFallibleContextViolation
222SequencingCheck.FallibleInGuaranteedContextViolation
223SequencingCheck.CausalityConstraintViolation
224SequencingCheck.CallHasEmptyTranscripts
225DisjointCheck.ShieldedInputsDisjointFailure
226DisjointCheck.ShieldedOutputsDisjointFailure
227DisjointCheck.UnshieldedInputsDisjointFailure
228TransactionApplication.IntentTtlExpired
229TransactionApplication.IntentTtlTooFarInFuture
230TransactionApplication.IntentAlreadyExists
231FeeCalculation.OutsideTimeToDismiss
232FeeCalculation.BlockLimitExceeded
233MalformedContractDeploy.NonZeroBalance
234MalformedContractDeploy.IncorrectChargedState
235Zswap.Malformed.InvalidProof
236Zswap.Malformed.ContractSentCiphertext
237Zswap.Malformed.NonDisjointCoinMerge
238Zswap.Malformed.NotNormalized

Infrastructure errors (150–157, 165)

원장 조회나 수수료 계산 같은 내부 작업을 노드가 완료하지 못한 경우입니다. 제출된 트랜잭션 자체가 원인은 아닙니다.

Show full table
CodeVariant
150LedgerCacheError
151NoLedgerState
152LedgerStateScaleDecodingError
153ContractCallCostError
154BlockLimitExceededError
155FeeCalculationError
156ContractNotPresent
157BeneficiaryNotFound
165GetTransactionContextError

System transactions (201–211, 245–247)

지급(payout)이나 트레저리 작업과 같은 시스템 단위 트랜잭션이 거부된 경우입니다. 일반적으로 검증자나 블록 생산자에게만 보입니다.

Show full table
CodeVariant
201IllegalPayout
202InsufficientTreasuryFunds
203CommitmentAlreadyPresent
204UnknownError
205ReplayProtectionFailure (Retired)
206IllegalReserveDistribution
207GenerationInfoAlreadyPresent
208InvalidBasisPoints
209InvariantViolation
210TreasuryDisabled
211MerkleTreeError
245SystemTransaction.ReplayProtectionFailure.IntentTtlExpired
246SystemTransaction.ReplayProtectionFailure.IntentTtlTooFarInFuture
247SystemTransaction.ReplayProtectionFailure.IntentAlreadyExists

Host API error (255)

위 분류에 속하지 않는 노드 호스트 API 오류를 나타내는 예약된 변형입니다.

Show full table
CodeVariant
255HostApiError

Common causes and fixes

다음 변형들이 1010 오류의 대부분을 차지합니다.

155 FeeCalculationError — 제출된 트랜잭션의 수수료 계산이 실패한 경우

대부분 오래된 수수료 추정값이나 구버전 런타임 클라이언트에서 비롯됩니다. 클라이언트가 보고 있는 네트워크 수수료를 갱신한 뒤 다시 제출하세요. 그래도 오류가 계속되면 사용 중인 런타임 패키지가 릴리스 호환성 매트릭스의 값과 일치하는지 확인하세요.

154 BlockLimitExceededError — 트랜잭션이 블록 리소스 한도를 초과하는 경우

트랜잭션에 포함된 인텐트, 호출 등의 개수를 줄이세요. 배치 작업이라면 여러 트랜잭션으로 나누어 실행하세요.

108 ReplayCounterMismatch / 193 ReplayProtectionViolation — replay protection이 트랜잭션을 거부한 경우

replay 카운터가 오래되었거나 인텐트의 TTL 윈도가 만료된 상황입니다. 현재 카운터를 다시 가져온 뒤 트랜잭션을 새로 만드세요. 변형 242244228230은 더 구체적인 원인(TTL 만료, TTL이 너무 먼 미래, 인텐트가 이미 존재)을 알려줍니다.

115 InvalidProof / 235 Zswap.Malformed.InvalidProof — 영지식 증명 검증에 실패한 경우

증명 서버가 노드 및 SDK와 호환되는 버전으로 실행 중인지 확인하세요. proof server 실행릴리스 호환성 매트릭스를 참조하세요.

166 InvalidNetworkId — 트랜잭션이 다른 네트워크용으로 만들어진 경우

SDK와 지갑이 트랜잭션을 제출하려는 노드와 같은 네트워크 ID(예: PreprodTestNet02)로 설정되어 있는지 확인하세요.

126 Unbalanced / 138 BalanceCheckOverspend — 트랜잭션의 입력과 출력 균형이 맞지 않는 경우

지갑이 보유 코인 집합으로 감당할 수 없는 양을 지출하려 했거나, 잔돈(change) 출력을 잘못 계산한 경우입니다. 지갑을 다시 동기화한 뒤 트랜잭션을 새로 만드세요.

When 1010 has no inner u8

응답에 code: 1010은 있지만 Custom error: N 부분이 없다면, Midnight 원장 로직이 아니라 그 위 단계인 Substrate 검증에서 거부가 일어난 것입니다. 가장 흔한 원인은 다음과 같습니다.

  • Bad signature: 서명 키가 발신자와 일치하지 않거나, 서명 후 페이로드가 변경된 경우
  • Stale era: mortal era 윈도가 지난 경우. 현재 블록 해시를 다시 가져와 트랜잭션을 새로 만드세요.
  • Wrong nonce: 노드의 계정 nonce가 서명 시점에 사용한 값과 다른 경우. 현재 nonce를 조회한 뒤 다시 제출하세요.

이러한 거부는 원장에 도달하지 않으므로 LedgerApiError 표에는 나타나지 않습니다.

Verify the fix

해당 변형을 식별해 조치한 뒤, 트랜잭션을 다시 제출하여 정상적으로 받아들여지는지 확인하세요.

# Re-submit and observe the response
curl -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"author_submitExtrinsic","params":["0x..."]}' \
http://localhost:9944

제출이 성공하면 오류 외피 대신 트랜잭션 해시가 반환됩니다.

Get help

변형을 식별하지 못하거나, 위 조치를 적용한 뒤에도 거부가 계속된다면 다음을 확인하세요.

  • Confirm the node version: 변형 번호는 릴리스에 따라 달라집니다. 사용 중인 네트워크의 버전에 해당하는 노드 릴리스 노트를 확인하세요.
  • Check the compatibility matrix: 증명 서버, 런타임, SDK가 릴리스 호환성 매트릭스에서 지원하는 조합과 일치하는지 확인하세요.