Skip to content

Commit 51a8bca

Browse files
more verbose blockhash errors
1 parent 69a0773 commit 51a8bca

File tree

9 files changed

+81
-46
lines changed

9 files changed

+81
-46
lines changed

book/api/metrics-generated.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,9 @@
10251025
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">max_&#8203;loaded_&#8203;accounts_&#8203;data_&#8203;size_&#8203;exceeded</span>"} | counter | Result of loading and executing a transaction. (The total account data size of the loaded accounts exceeds the consensus limit) |
10261026
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">duplicate_&#8203;instruction</span>"} | counter | Result of loading and executing a transaction. (A compute budget program instruction was invoked more than once) |
10271027
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">invalid_&#8203;loaded_&#8203;accounts_&#8203;data_&#8203;size_&#8203;limit</span>"} | counter | Result of loading and executing a transaction. (The compute budget program was invoked and set the loaded accounts data size to zero) |
1028+
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">blockhash_&#8203;nonce_&#8203;not_&#8203;advanceable</span>"} | counter | Result of loading and executing a transaction. (The transaction references a nonce account that is not advanceable) |
1029+
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">blockhash_&#8203;no_&#8203;advance_&#8203;nonce_&#8203;instr</span>"} | counter | Result of loading and executing a transaction. (The transaction references a nonce account that is not advanceable) |
1030+
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">blockhash_&#8203;advance_&#8203;nonce_&#8203;fail</span>"} | counter | Result of loading and executing a transaction. (The transaction references a nonce account that is not advanceable) |
10281031
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">account_&#8203;in_&#8203;use</span>"} | counter | Result of loading and executing a transaction. (The transaction conflicts with another transaction in the microblock. TODO: No longer possible with smart dispatcher) |
10291032
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">account_&#8203;loaded_&#8203;twice</span>"} | counter | Result of loading and executing a transaction. (The transaction references the same account twice) |
10301033
| <span class="metrics-name">bankf_&#8203;transaction_&#8203;result</span><br/>{transaction_&#8203;result="<span class="metrics-enum">signature_&#8203;failure</span>"} | counter | Result of loading and executing a transaction. (The transaction had an invalid signature) |

src/disco/metrics/generated/fd_metrics_bankf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const fd_metrics_meta_t FD_METRICS_BANKF[FD_METRICS_BANKF_TOTAL] = {
1818
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED ),
1919
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, DUPLICATE_INSTRUCTION ),
2020
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT ),
21+
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, BLOCKHASH_NONCE_NOT_ADVANCEABLE ),
22+
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, BLOCKHASH_NO_ADVANCE_NONCE_INSTR ),
23+
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, BLOCKHASH_ADVANCE_NONCE_FAIL ),
2124
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, ACCOUNT_IN_USE ),
2225
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, ACCOUNT_LOADED_TWICE ),
2326
DECLARE_METRIC_ENUM( BANKF_TRANSACTION_RESULT, COUNTER, TRANSACTION_RESULT, SIGNATURE_FAILURE ),

src/disco/metrics/generated/fd_metrics_bankf.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_TYPE (FD_METRICS_TYPE_COUNTER)
1212
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_DESC "Result of loading and executing a transaction."
1313
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_CVT (FD_METRICS_CONVERTER_NONE)
14-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_CNT (23UL)
14+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_CNT (26UL)
1515

1616
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_SUCCESS_OFF (16UL)
1717
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_INSTRUCTON_ERROR_OFF (17UL)
@@ -29,15 +29,18 @@
2929
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED_OFF (29UL)
3030
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_DUPLICATE_INSTRUCTION_OFF (30UL)
3131
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_OFF (31UL)
32-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_ACCOUNT_IN_USE_OFF (32UL)
33-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_ACCOUNT_LOADED_TWICE_OFF (33UL)
34-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_SIGNATURE_FAILURE_OFF (34UL)
35-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_TOO_MANY_ACCOUNT_LOCKS_OFF (35UL)
36-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_INSUFFICIENT_FUNDS_FOR_RENT_OFF (36UL)
37-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_UNBALANCED_TRANSACTION_OFF (37UL)
38-
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_BUNDLE_PEER_OFF (38UL)
32+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_BLOCKHASH_NONCE_NOT_ADVANCEABLE_OFF (32UL)
33+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_BLOCKHASH_NO_ADVANCE_NONCE_INSTR_OFF (33UL)
34+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_BLOCKHASH_ADVANCE_NONCE_FAIL_OFF (34UL)
35+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_ACCOUNT_IN_USE_OFF (35UL)
36+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_ACCOUNT_LOADED_TWICE_OFF (36UL)
37+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_SIGNATURE_FAILURE_OFF (37UL)
38+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_TOO_MANY_ACCOUNT_LOCKS_OFF (38UL)
39+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_INSUFFICIENT_FUNDS_FOR_RENT_OFF (39UL)
40+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_UNBALANCED_TRANSACTION_OFF (40UL)
41+
#define FD_METRICS_COUNTER_BANKF_TRANSACTION_RESULT_BUNDLE_PEER_OFF (41UL)
3942

40-
#define FD_METRICS_BANKF_TOTAL (23UL)
43+
#define FD_METRICS_BANKF_TOTAL (26UL)
4144
extern const fd_metrics_meta_t FD_METRICS_BANKF[FD_METRICS_BANKF_TOTAL];
4245

4346
#endif /* HEADER_fd_src_disco_metrics_generated_fd_metrics_bankf_h */

src/disco/metrics/generated/fd_metrics_enums.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@
490490
#define FD_METRICS_ENUM_TRANSACTION_ERROR_V_BUNDLE_PEER_NAME "bundle_peer"
491491

492492
#define FD_METRICS_ENUM_TRANSACTION_RESULT_NAME "transaction_result"
493-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_CNT (23UL)
493+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_CNT (26UL)
494494
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_SUCCESS_IDX 0
495495
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_SUCCESS_NAME "success"
496496
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INSTRUCTON_ERROR_IDX 1
@@ -523,19 +523,25 @@
523523
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_DUPLICATE_INSTRUCTION_NAME "duplicate_instruction"
524524
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_IDX 15
525525
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_NAME "invalid_loaded_accounts_data_size_limit"
526-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_IN_USE_IDX 16
526+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NONCE_NOT_ADVANCEABLE_IDX 16
527+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NONCE_NOT_ADVANCEABLE_NAME "blockhash_nonce_not_advanceable"
528+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NO_ADVANCE_NONCE_INSTR_IDX 17
529+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NO_ADVANCE_NONCE_INSTR_NAME "blockhash_no_advance_nonce_instr"
530+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_ADVANCE_NONCE_FAIL_IDX 18
531+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_ADVANCE_NONCE_FAIL_NAME "blockhash_advance_nonce_fail"
532+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_IN_USE_IDX 19
527533
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_IN_USE_NAME "account_in_use"
528-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_LOADED_TWICE_IDX 17
534+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_LOADED_TWICE_IDX 20
529535
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_ACCOUNT_LOADED_TWICE_NAME "account_loaded_twice"
530-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_SIGNATURE_FAILURE_IDX 18
536+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_SIGNATURE_FAILURE_IDX 21
531537
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_SIGNATURE_FAILURE_NAME "signature_failure"
532-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_TOO_MANY_ACCOUNT_LOCKS_IDX 19
538+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_TOO_MANY_ACCOUNT_LOCKS_IDX 22
533539
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_TOO_MANY_ACCOUNT_LOCKS_NAME "too_many_account_locks"
534-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INSUFFICIENT_FUNDS_FOR_RENT_IDX 20
540+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INSUFFICIENT_FUNDS_FOR_RENT_IDX 23
535541
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_INSUFFICIENT_FUNDS_FOR_RENT_NAME "insufficient_funds_for_rent"
536-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_UNBALANCED_TRANSACTION_IDX 21
542+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_UNBALANCED_TRANSACTION_IDX 24
537543
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_UNBALANCED_TRANSACTION_NAME "unbalanced_transaction"
538-
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BUNDLE_PEER_IDX 22
544+
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BUNDLE_PEER_IDX 25
539545
#define FD_METRICS_ENUM_TRANSACTION_RESULT_V_BUNDLE_PEER_NAME "bundle_peer"
540546

541547
#define FD_METRICS_ENUM_SHRED_PROCESSING_RESULT_NAME "shred_processing_result"

src/disco/metrics/metrics.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -657,25 +657,28 @@ metric introduced.
657657
<int value="13" name="MaxLoadedAccountsDataSizeExceeded" label="The total account data size of the loaded accounts exceeds the consensus limit" />
658658
<int value="14" name="DuplicateInstruction" label="A compute budget program instruction was invoked more than once" />
659659
<int value="15" name="InvalidLoadedAccountsDataSizeLimit" label="The compute budget program was invoked and set the loaded accounts data size to zero" />
660+
<int value="16" name="BlockhashNonceNotAdvanceable" label="The transaction references a nonce account that is not advanceable" />
661+
<int value="17" name="BlockhashNoAdvanceNonceInstr" label="The transaction references a nonce account that is not advanceable" />
662+
<int value="18" name="BlockhashAdvanceNonceFail" label="The transaction references a nonce account that is not advanceable" />
660663

661664
<!-- Preflight errors during replay. These are errors in validation
662665
before we begin executing the transaction, which can only
663666
occur during replay, as such transactions do not make it to
664667
execution when we are leader. -->
665-
<int value="16" name="AccountInUse" label="The transaction conflicts with another transaction in the microblock. TODO: No longer possible with smart dispatcher" />
666-
<int value="17" name="AccountLoadedTwice" label="The transaction references the same account twice" />
667-
<int value="18" name="SignatureFailure" label="The transaction had an invalid signature" />
668-
<int value="19" name="TooManyAccountLocks" label="The transaction references too many accounts. TODO: No longer possible with smart dispatcher" />
668+
<int value="19" name="AccountInUse" label="The transaction conflicts with another transaction in the microblock. TODO: No longer possible with smart dispatcher" />
669+
<int value="20" name="AccountLoadedTwice" label="The transaction references the same account twice" />
670+
<int value="21" name="SignatureFailure" label="The transaction had an invalid signature" />
671+
<int value="22" name="TooManyAccountLocks" label="The transaction references too many accounts. TODO: No longer possible with smart dispatcher" />
669672

670673
<!-- Execution errors. These are errors which occur during actual
671674
execution of the transaction, after it has been validated. -->
672-
<int value="20" name="InsufficientFundsForRent" label="The transaction would leave an account with a lower balance than the rent-exempt minimum" />
673-
<int value="21" name="UnbalancedTransaction" label="The total referenced account lamports before and after the transaction was unbalanced" />
675+
<int value="23" name="InsufficientFundsForRent" label="The transaction would leave an account with a lower balance than the rent-exempt minimum" />
676+
<int value="24" name="UnbalancedTransaction" label="The total referenced account lamports before and after the transaction was unbalanced" />
674677

675678
<!-- Errors that aren't returned by the runtime execution itself,
676679
but are used by bank as an additional reason transactions
677680
might fail. -->
678-
<int value="22" name="BundlePeer" label="The transaction was part of a bundle and an earlier transaction in the bundle failed" />
681+
<int value="25" name="BundlePeer" label="The transaction was part of a bundle and an earlier transaction in the bundle failed" />
679682
</enum>
680683

681684
<tile name="bankf">

src/discof/bank/fd_bank_err.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ fd_bank_err_from_runtime_err( int err ) {
1919
case FD_RUNTIME_TXN_ERR_INVALID_ACCOUNT_FOR_FEE: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_INVALID_ACCOUNT_FOR_FEE_IDX;
2020
case FD_RUNTIME_TXN_ERR_ALREADY_PROCESSED: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_ALREADY_PROCESSED_IDX;
2121
case FD_RUNTIME_TXN_ERR_BLOCKHASH_NOT_FOUND: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NOT_FOUND_IDX;
22+
case FD_RUNTIME_TXN_ERR_BLOCKHASH_NONCE_NOT_ADVANCEABLE: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NONCE_NOT_ADVANCEABLE_IDX;
23+
case FD_RUNTIME_TXN_ERR_BLOCKHASH_NO_ADVANCE_NONCE_INSTR: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_NO_ADVANCE_NONCE_INSTR_IDX;
24+
case FD_RUNTIME_TXN_ERR_BLOCKHASH_ADVANCE_NONCE_FAIL: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_BLOCKHASH_ADVANCE_NONCE_FAIL_IDX;
2225
case FD_RUNTIME_TXN_ERR_INVALID_PROGRAM_FOR_EXECUTION: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_INVALID_PROGRAM_FOR_EXECUTION_IDX;
2326
case FD_RUNTIME_TXN_ERR_ADDRESS_LOOKUP_TABLE_NOT_FOUND: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_ADDRESS_LOOKUP_TABLE_NOT_FOUND_IDX;
2427
case FD_RUNTIME_TXN_ERR_INVALID_ADDRESS_LOOKUP_TABLE_OWNER: return FD_METRICS_ENUM_TRANSACTION_RESULT_V_INVALID_ADDRESS_LOOKUP_TABLE_OWNER_IDX;

src/flamenco/runtime/fd_runtime_err.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,11 @@
4444
#define FD_RUNTIME_TXN_ERR_PROGRAM_CACHE_HIT_MAX_LIMIT -38
4545
#define FD_RUNTIME_TXN_ERR_COMMIT_CANCELLED -39
4646

47+
/* Transaction error that does not directly map to an Agave error.
48+
These all map to FD_RUNTIME_TXN_ERR_BLOCKHASH_NOT_FOUND (-8) and are
49+
just differentiated to provide additional insight into the error.*/
50+
#define FD_RUNTIME_TXN_ERR_BLOCKHASH_NONCE_NOT_ADVANCEABLE -8000
51+
#define FD_RUNTIME_TXN_ERR_BLOCKHASH_NO_ADVANCE_NONCE_INSTR -8001
52+
#define FD_RUNTIME_TXN_ERR_BLOCKHASH_ADVANCE_NONCE_FAIL -8002
53+
4754
#endif /* HEADER_fd_src_flamenco_runtime_fd_runtime_err_h */

0 commit comments

Comments
 (0)