archethic-foundation / archethic-foundation/archethic-node

Validation Error as Error Code

Open
#965 0 comments 0 reactions 0 assignees View on GitHub
feature mining serialization transaction
Dominant language
Elixir
Stars
82
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Is your feature request related to a problem?

During transaction validation, the miners check the transaction and store the error reason in the validation state and the validation stamp. However, the validation stamp's error is meaningless if the validation's state is not given.
Moreover, to avoid recomputing the reason of the pending transaction validation, we should have a way to enhance the discoverability of the error reasons.

### Describe the solution you'd like

We should then a list of error codes given by the pending transaction validation and for any further network issues, helping to reduce the network bandwidth and help to discover error's reason.

For example we might have:

- INVALID_CONTRACT_CODE
- MISSING_AUTHORIZED_KEY_CONTRACT
- INVALID_CONTRACT_SIZE
- INVALID_OWNERSHIP_SECRET
- INVALID_OWNERSHIP_AUTHORIZED_KEYS
- INVALID_TRANSFER_TX
- INVALID_HOSTING_TX
- INVALID_NODE_REWARD_TIME
- INVALID_NODE_REWARD_TRANSFERS
- INVALID_NODE_TX_CONTENT
- INVALID_NODE_CERT
- INVALID_NODE_ORIGIN
- INVALID_NODE_IP
- NODE_DUPLICATE
- INVALID_ORIGIN_CERT
- ORIGIN_KEY_DUPLICATE
- INVALID_ORIGIN_TX_CONTENT
- INVALID_SHARED_SECRETS_TX_CONTENT
- INVALID_AUTHORIZED_NODES
- INVALID_SHARED_SECRETS_TIME
- INVALID_CODE_PROPOSAL
- CODE_APPROVAL_DUPLICATE
- CODE_APPROVAL_UNAUTH
- CODE_PROPOSAL_NOT_FOUND
- CODE_APPROVAL_NO_RECIPIENTS
- INVALID_KEYCHAIN_TX
- INVALID_KEYCHAIN_DID
- MISSING_KEYCHAIN_ACCESS_PREV_KEY_AUTH
- INVALID_KEYCHAIN_ACCESS_TX
- INVALID_MINT_REWARDS_SUPPLY
- INVALID_MINT_DUPLICATE
- INVALID_ORACLE_TIME
- INVALID_ORACLE_TX_CONTENT
- INVALID_ORACLE_SUMMARY_TIME
- INVALID_ORACLE_SUMMARY_TX_CONTENT
- MISSING_CONTRACT_CODE
- MISSING_DATA

### Additional context

Epic: #306

Contributor guide

Open the contributing guide

Research direction

No implementation files, tests, or entry points are named. Start by tracing how pending transaction validation stores its state and validation stamp, then review Epic #306. Done should mean validation exposes stable error codes for the listed failure reasons without recomputing them for network consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.