|
126 | 126 |
|
127 | 127 | ### INV-014: Pause Functionality |
128 | 128 |
|
129 | | -- **Invariant**: The protocol must be pausable in emergency situations |
| 129 | +- **Invariant**: The protocol must be pausable in emergency situations. This should prevent inbound and outbound flows of assets. |
130 | 130 | - **Description**: Allows immediate halt of operations if vulnerabilities are discovered |
131 | 131 | - **Enforcement**: Pause state with operation blocking modifiers/constraints |
132 | 132 | - **Error Codes**: `Paused` (Solana), **MISSING** (Sui) |
|
218 | 218 |
|
219 | 219 | ### INV-024: Non-Zero Threshold Requirement |
220 | 220 |
|
221 | | -- **Invariant**: When transceivers are registered, threshold must be greater than zero |
| 221 | +- **Invariant**: Threshold must be greater than zero (after initial deployment) |
222 | 222 | - **Description**: Prevents configuration where messages cannot be approved due to zero threshold |
223 | 223 | - **Enforcement**: Zero threshold validation when transceivers exist |
224 | 224 | - **Error Codes**: `ZeroThreshold` (EVM/Solana), `EZeroThreshold` (Sui) |
225 | 225 | - **Code Reference**: `if (numTransceivers.registered > 0 && threshold == 0) revert ZeroThreshold();` |
226 | 226 |
|
227 | 227 | ### INV-025: Minimum Transceiver Requirement |
228 | 228 |
|
229 | | -- **Invariant**: At least one transceiver must be enabled for operations |
| 229 | +- **Invariant**: At least one transceiver must be enabled for operations (after initial deployment) |
230 | 230 | - **Description**: Prevents operations when no transceivers are available to process messages |
231 | 231 | - **Enforcement**: Enabled transceiver count validation before operations |
232 | 232 | - **Error Codes**: `NoEnabledTransceivers` (EVM), `NoRegisteredTransceivers` (Solana) |
233 | | -- **Code Reference**: `if (numEnabledTransceivers == 0) revert NoEnabledTransceivers();` |
| 233 | + |
| 234 | +### INV-026: Transceiver Registration Requirement |
| 235 | + |
| 236 | +- **Invariant**: A transceiver cannot be unregistered and its index must not change |
| 237 | +- **Description**: Transceivers should never be truly deleted, only disabled. This preserves their index into the bitmap which is crucial for attestation. |
| 238 | +- **Enforcement**: Assertions on transceiver management code paths |
| 239 | + |
| 240 | +### INV-027: Transceiver Registration Requirement |
| 241 | + |
| 242 | +- **Invariant**: The next transceiver index must always increase monotically |
| 243 | +- **Description**: The next transceiver index should always go up by one. This guarantees uniqueness of indices into the bitmap which is crucial for attestation. |
| 244 | +- **Enforcement**: Assertions on transceiver management code paths |
234 | 245 |
|
235 | 246 | ## Timing and Release Controls |
236 | 247 |
|
237 | | -### INV-026: Release Timing Validation |
| 248 | +### INV-028: Release Timing Validation |
238 | 249 |
|
239 | 250 | - **Invariant**: Transfers can only be released after rate limit delay expires |
240 | 251 | - **Description**: Enforces time-based delays for rate-limited transfers |
241 | 252 | - **Enforcement**: Timestamp validation before transfer release |
242 | 253 | - **Error Codes**: `CantReleaseYet` (Solana), `ECantReleaseYet` (Sui) |
243 | 254 | - **Code Reference**: Rate limiter queue system with timestamp checks, `try_release()` functions |
244 | 255 |
|
245 | | -### INV-027: Transfer Redemption Controls |
| 256 | +### INV-029: Transfer Redemption Controls |
246 | 257 |
|
247 | 258 | - **Invariant**: Transfers must be properly approved and not already redeemed before processing |
248 | 259 | - **Description**: Prevents unauthorized or duplicate transfer redemptions |
|
252 | 263 |
|
253 | 264 | ## Message Size Constraints |
254 | 265 |
|
255 | | -### INV-028: Payload Length Limitation |
| 266 | +### INV-030: Payload Length Limitation |
256 | 267 |
|
257 | 268 | - **Invariant**: NttManagerMessages and AdditionalPayloads must not exceed uint16 in size |
258 | 269 | - **Description**: Prevents unbounded message sizes that could cause processing issues |
259 | 270 | - **Enforcement**: Assertions in encoding logic |
260 | 271 | - **Error Codes**: `PayloadTooLong` (EVM) |
261 | 272 | - **Code Reference**: `TransceiverStructs.sol` (EVM), implementation of `Writable` trait for `NativeTokenTransfer` (Solana) |
262 | 273 |
|
263 | | -### INV-029: Transceiver Instruction Length Limitation |
| 274 | +### INV-031: Transceiver Instruction Length Limitation |
264 | 275 |
|
265 | 276 | - **Invariant**: Individual transceiver instruction payloads must not exceed uint8 in size |
266 | 277 | - **Description**: Prevents unbounded message sizes that could cause processing issues |
|
0 commit comments