Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ACP-25, which proposes an explicit AppError message allowing VM requests to fail without requiring the sender to wait for a timeout.
This article translates, summarizes, and supplements the material linked below.
I have also covered other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ACP-25 adds a mechanism for a virtual machine (VM) to notify another VM of an application-specific error.
Before the proposed change, a VM sending an AppRequest (an application-specific request message) had no direct way to learn that the receiving VM could not process it. The sender had to wait and interpret the absence of a response as failure.
ACP-25 addresses this limitation by introducing an AppError message that lets the receiving VM explicitly report a failure.
Motivation
Avalanche VMs can build custom peer-to-peer application protocols using message types such as AppRequest, AppResponse, and AppGossip. Successful processing of an AppRequest produces an AppResponse.
When processing fails, for example because resources are insufficient or a request is invalid, the original mechanism relies on a timeout to detect failure.
This has several drawbacks.
-
Unnecessary waiting Without an explicit error response, a client must wait for the timeout, adding delay to failure detection.
-
Limited peer assessment The networking layer does not know the VM's internal behavior and cannot distinguish a peer that correctly encounters an application error from one that simply fails to respond. This makes peer reliability difficult to score accurately.
-
Inconsistent failure handling Clients must independently decide how to handle missing responses, reducing consistency and efficiency across the system.
Introducing a native application error type, AppError, allows VMs to report failures immediately.
The expected improvements are:
- Faster failure detection without waiting for a timeout when an error response is available.
- Better peer scoring because Avalanche nodes can distinguish explicit error responses from missing responses.
- Clearer and more predictable application interactions, with a defined response for either successful or failed processing.
Specification
AppError Message
ACP-25 introduces the following protobuf definition, as reproduced in the original article.
message AppError {
bytes chain_id = 1;
uint32 request_id = 2;
uint32 error_code = 3;
string error_message = 4;
}This message represents an error response to an AppRequest.
| Field | Type | Description |
|---|---|---|
chain_id |
bytes | Must match the chain ID in the original AppRequest, linking the error to the appropriate chain. |
request_id |
uint32 | Must match the request ID in the original AppRequest, identifying the request that failed. |
error_code |
uint32 in the reproduced snippet | Application-defined error code. Using a consistent code for the same condition is recommended so clients can classify errors programmatically. Negative codes are reserved for protocol-defined errors, and positive codes are available to VMs. |
error_message |
string | Human-readable error message. Clients should classify errors using error_code, not the message text. |
The reproduced protobuf snippet declares error_code as unsigned, while the accompanying rules reserve negative values. These are inconsistent; consult the linked ACP and AvalancheGo implementation for the applicable signed field definition before implementing the protocol.
The design preserves the association between a request and its error response while standardizing error reporting.
Reserved Error Codes
The Avalanche protocol reserves certain codes so clients can share a common understanding of basic error conditions.
| Error code | Description |
|---|---|
| 0 | Undefined |
| -1 | Network timeout |
Negative values, including -1, are reserved for protocol-defined errors. Zero is treated as undefined, while positive values can be defined by individual VMs.
Error-Handling Rules
The specification requires one of the following responses to an AppRequest.
- Return an
AppResponsewhen processing succeeds. - Return an
AppErrorwhen processing fails.
Either response must be sent before the deadline specified in the original AppRequest.
This establishes a clear obligation for the receiving VM to return a success or failure result rather than silently ignoring the request. It does not guarantee network delivery; timeouts are still necessary when a peer fails to respond or the response is lost.
When an error can be returned explicitly, the sender can continue processing without unnecessary waiting.
Compatibility
The introduction of AppError changes network behavior and requires network-wide activation through an upgrade.
Under the earlier rules, the sender had to wait for a timeout if an AppRequest did not receive an AppResponse. The proposed change requires either:
AppResponsefor success.AppErrorfor failure.
Before activation, failures were detected through the existing timeout mechanism. After activation, explicit responses are required, making request handling more predictable and efficient.
Reference Implementations
ACP-25 implementations were published as pull requests in the AvalancheGo repository. Developers can inspect the message definitions and processing logic.
-
Message definition: ava-labs/avalanchego/pull/2111 This pull request introduces the protobuf definition for
AppError. -
Message processing: ava-labs/avalanchego/pull/2248 This pull request implements logic for handling incoming
AppErrormessages and responding toAppRequest.
These references show how the proposal is incorporated into the software.
Security
Introducing a new message type requires consideration of security risks. In particular, peers can send arbitrary AppError messages.
A malicious node could intentionally return errors to trigger error-handling logic in another VM. Potential risks include:
- Clients receiving excessive errors and unnecessarily interrupting processing.
- Attackers supplying misleading
error_codeorerror_messagevalues to cause confusion.
Implementations should therefore:
- Avoid trusting error message contents blindly and follow the protocol's
error_coderules. - Consider peer scoring mechanisms for nodes that repeatedly send inappropriate errors, while distinguishing application-level errors from peer misbehavior.
These measures can help mitigate abuse while improving error handling in VM communication.
Conclusion
ACP-25 proposes an explicit AppError response to report failed VM requests without waiting for a timeout when the error can be delivered.
If you have questions, feel free to contact me on Twitter.
I also publish articles on the following platforms.


