miden-node-store 0.14.7

Miden node's state store component
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
use std::io;

use miden_node_proto::domain::account::NetworkAccountError;
use miden_node_proto::domain::block::InvalidBlockRange;
use miden_node_proto::errors::{ConversionError, GrpcError};
use miden_node_utils::ErrorReport;
use miden_node_utils::limiter::QueryLimitError;
use miden_protocol::Word;
use miden_protocol::account::AccountId;
use miden_protocol::block::BlockNumber;
use miden_protocol::crypto::merkle::MerkleError;
use miden_protocol::crypto::merkle::mmr::MmrError;
use miden_protocol::crypto::utils::DeserializationError;
use miden_protocol::errors::{
    AccountDeltaError,
    AccountError,
    AccountTreeError,
    AssetError,
    AssetVaultError,
    NoteError,
    NullifierTreeError,
    StorageMapError,
};
use miden_protocol::note::{NoteId, Nullifier};
use miden_protocol::transaction::OutputNote;
use thiserror::Error;
use tokio::sync::oneshot::error::RecvError;
use tonic::Status;

use crate::account_state_forest::{AccountStateForestError, WitnessError};
use crate::db::models::conv::DatabaseTypeConversionError;

// PROOF SCHEDULER ERRORS
// =================================================================================================

#[derive(Debug, Error)]
pub enum ProofSchedulerError {
    #[error("no proving inputs found for block {0}")]
    MissingProvingInputs(BlockNumber),
    #[error("failed to deserialize proving inputs for block")]
    DeserializationFailed(#[source] DeserializationError),
    #[error("invalid remote prover endpoint: {0}")]
    InvalidProverEndpoint(String),
}

// DATABASE ERRORS
// =================================================================================================

#[derive(Debug, Error)]
pub enum DatabaseError {
    // ERRORS WITH AUTOMATIC CONVERSIONS FROM NESTED ERROR TYPES
    // ---------------------------------------------------------------------------------------------
    #[error("account error")]
    AccountError(#[from] AccountError),
    #[error("asset vault error")]
    AssetVaultError(#[from] AssetVaultError),
    #[error("asset error")]
    AssetError(#[from] AssetError),
    #[error("closed channel")]
    ClosedChannel(#[from] RecvError),
    #[error("database error")]
    DatabaseError(#[from] miden_node_db::DatabaseError),
    #[error("deserialization failed")]
    DeserializationError(#[from] DeserializationError),
    #[error("I/O error")]
    IoError(#[from] io::Error),
    #[error("merkle error")]
    MerkleError(#[from] MerkleError),
    #[error("note error")]
    NoteError(#[from] NoteError),
    #[error("storage map error")]
    StorageMapError(#[from] StorageMapError),
    #[error(transparent)]
    Diesel(#[from] diesel::result::Error),
    #[error(transparent)]
    QueryParamLimit(#[from] QueryLimitError),

    // OTHER ERRORS
    // ---------------------------------------------------------------------------------------------
    #[error("account commitment mismatch (expected {expected}, but calculated is {calculated})")]
    AccountCommitmentsMismatch { expected: Word, calculated: Word },
    #[error("account {0} not found")]
    AccountNotFoundInDb(AccountId),
    #[error("accounts {0:?} not found")]
    AccountsNotFoundInDb(Vec<AccountId>),
    #[error("account {0} is not on the chain")]
    AccountNotPublic(AccountId),
    #[error("invalid block parameters: block_from ({from}) > block_to ({to})")]
    InvalidBlockRange { from: BlockNumber, to: BlockNumber },
    #[error("data corrupted: {0}")]
    DataCorrupted(String),
    #[error(transparent)]
    SqlValueConversion(#[from] DatabaseTypeConversionError),
    #[error("storage root not found for account {account_id}, slot {slot_name}, block {block_num}")]
    StorageRootNotFound {
        account_id: AccountId,
        slot_name: String,
        block_num: BlockNumber,
    },
}

impl From<DatabaseError> for Status {
    fn from(err: DatabaseError) -> Self {
        match err {
            DatabaseError::AccountNotFoundInDb(_)
            | DatabaseError::AccountsNotFoundInDb(_)
            | DatabaseError::AccountNotPublic(_) => Status::not_found(err.to_string()),

            _ => Status::internal(err.to_string()),
        }
    }
}

// INITIALIZATION ERRORS
// =================================================================================================

#[derive(Error, Debug)]
pub enum StateInitializationError {
    #[error("account tree IO error: {0}")]
    AccountTreeIoError(String),
    #[error("nullifier tree IO error: {0}")]
    NullifierTreeIoError(String),
    #[error("database error")]
    DatabaseError(#[from] DatabaseError),
    #[error("failed to create nullifier tree")]
    FailedToCreateNullifierTree(#[from] NullifierTreeError),
    #[error("failed to create accounts tree")]
    FailedToCreateAccountsTree(#[source] AccountTreeError),
    #[error("failed to load data directory")]
    DataDirectoryLoadError(#[source] std::io::Error),
    #[error("failed to load block store")]
    BlockStoreLoadError(#[source] std::io::Error),
    #[error("failed to load database")]
    DatabaseLoadError(#[source] DatabaseError),
    #[error("account state forest error")]
    AccountStateForestError(#[from] AccountStateForestError),
    #[error(
        "{tree_name} SMT root ({tree_root:?}) does not match expected root from block {block_num} \
         ({block_root:?}). Delete the tree storage directories and restart the node to rebuild \
         from the database."
    )]
    TreeStorageDiverged {
        tree_name: &'static str,
        block_num: BlockNumber,
        tree_root: Word,
        block_root: Word,
    },
    #[error("public account {0} is missing details in database")]
    PublicAccountMissingDetails(AccountId),
    #[error("failed to convert account to delta: {0}")]
    AccountToDeltaConversionFailed(String),
}

// ENDPOINT ERRORS
// =================================================================================================
#[derive(Error, Debug)]
pub enum InvalidBlockError {
    #[error("duplicated nullifiers {0:?}")]
    DuplicatedNullifiers(Vec<Nullifier>),
    #[error("invalid output note type: {0:?}")]
    InvalidOutputNoteType(Box<OutputNote>),
    #[error("invalid block tx commitment: expected {expected}, but got {actual}")]
    InvalidBlockTxCommitment { expected: Word, actual: Word },
    #[error("received invalid account tree root")]
    NewBlockInvalidAccountRoot,
    #[error("new block number must be 1 greater than the current block number")]
    NewBlockInvalidBlockNum {
        expected: BlockNumber,
        submitted: BlockNumber,
    },
    #[error("new block chain commitment is not consistent with chain MMR")]
    NewBlockInvalidChainCommitment,
    #[error("received invalid note root")]
    NewBlockInvalidNoteRoot,
    #[error("received invalid nullifier root")]
    NewBlockInvalidNullifierRoot,
    #[error("new block `prev_block_commitment` must match the chain's tip")]
    NewBlockInvalidPrevCommitment,
    #[error("nullifier in new block is already spent")]
    NewBlockNullifierAlreadySpent(#[source] NullifierTreeError),
    #[error("duplicate account ID prefix in new block")]
    NewBlockDuplicateAccountIdPrefix(#[source] AccountTreeError),
    #[error("failed to build note tree: {0}")]
    FailedToBuildNoteTree(String),
}

#[derive(Error, Debug)]
pub enum ApplyBlockError {
    // ERRORS WITH AUTOMATIC CONVERSIONS FROM NESTED ERROR TYPES
    // ---------------------------------------------------------------------------------------------
    #[error("database error")]
    DatabaseError(#[from] DatabaseError),
    #[error("I/O error")]
    IoError(#[from] io::Error),
    #[error("task join error")]
    TokioJoinError(#[from] tokio::task::JoinError),
    #[error("invalid block error")]
    InvalidBlockError(#[from] InvalidBlockError),
    #[error("account state forest error")]
    AccountStateForestError(#[from] AccountStateForestError),

    // OTHER ERRORS
    // ---------------------------------------------------------------------------------------------
    #[error("block applying was cancelled because of closed channel on database side")]
    ClosedChannel(#[from] RecvError),
    #[error("concurrent write detected")]
    ConcurrentWrite,
    #[error("database doesn't have any block header data")]
    DbBlockHeaderEmpty,
    #[error("database update failed: {0}")]
    DbUpdateTaskFailed(String),
}

impl From<ApplyBlockError> for Status {
    fn from(err: ApplyBlockError) -> Self {
        match err {
            ApplyBlockError::InvalidBlockError(_) => Status::invalid_argument(err.as_report()),

            _ => Status::internal(err.as_report()),
        }
    }
}

#[derive(Error, Debug, GrpcError)]
pub enum GetBlockHeaderError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("error retrieving the merkle proof for the block")]
    #[grpc(internal)]
    MmrError(#[from] MmrError),
}

#[derive(Error, Debug)]
pub enum GetBlockInputsError {
    #[error("failed to select note inclusion proofs")]
    SelectNoteInclusionProofError(#[source] DatabaseError),
    #[error("failed to select block headers")]
    SelectBlockHeaderError(#[source] DatabaseError),
    #[error(
        "highest block number {highest_block_number} referenced by a batch is newer than the latest block {latest_block_number}"
    )]
    UnknownBatchBlockReference {
        highest_block_number: BlockNumber,
        latest_block_number: BlockNumber,
    },
}

#[derive(Error, Debug)]
pub enum StateSyncError {
    #[error("database error")]
    DatabaseError(#[from] DatabaseError),
    #[error("block headers table is empty")]
    EmptyBlockHeadersTable,
    #[error("failed to build MMR delta")]
    FailedToBuildMmrDelta(#[from] MmrError),
}

#[derive(Error, Debug, GrpcError)]
pub enum SyncChainMmrError {
    #[error("invalid block range")]
    InvalidBlockRange(#[source] InvalidBlockRange),
    #[error("start block is not known")]
    FutureBlock {
        chain_tip: BlockNumber,
        block_from: BlockNumber,
    },
    #[error("malformed block number")]
    DeserializationFailed(#[source] ConversionError),
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[source] DatabaseError),
}

impl From<diesel::result::Error> for StateSyncError {
    fn from(value: diesel::result::Error) -> Self {
        Self::DatabaseError(DatabaseError::from(value))
    }
}

#[derive(Error, Debug, GrpcError)]
pub enum NoteSyncError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("database error")]
    #[grpc(internal)]
    UnderlyingDatabaseError(#[from] miden_node_db::DatabaseError),
    #[error("block headers table is empty")]
    #[grpc(internal)]
    EmptyBlockHeadersTable,
    #[error("error retrieving the merkle proof for the block")]
    #[grpc(internal)]
    MmrError(#[from] MmrError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("block_to ({block_to}) is greater than chain tip ({chain_tip})")]
    FutureBlock {
        chain_tip: BlockNumber,
        block_to: BlockNumber,
    },
    #[error("malformed note tags")]
    DeserializationFailed(#[from] ConversionError),
}

impl From<diesel::result::Error> for NoteSyncError {
    fn from(value: diesel::result::Error) -> Self {
        Self::DatabaseError(DatabaseError::from(value))
    }
}

#[derive(Error, Debug)]
pub enum GetCurrentBlockchainDataError {
    #[error("failed to retrieve block header")]
    ErrorRetrievingBlockHeader(#[source] DatabaseError),
    #[error("failed to instantiate MMR peaks")]
    InvalidPeaks(MmrError),
}

#[derive(Error, Debug)]
pub enum GetBatchInputsError {
    #[error("failed to select note inclusion proofs")]
    SelectNoteInclusionProofError(#[source] DatabaseError),
    #[error("failed to select block headers")]
    SelectBlockHeaderError(#[source] DatabaseError),
    #[error("set of blocks referenced by transactions is empty")]
    TransactionBlockReferencesEmpty,
    #[error(
        "highest block number {highest_block_num} referenced by a transaction is newer than the latest block {latest_block_num}"
    )]
    UnknownTransactionBlockReference {
        highest_block_num: BlockNumber,
        latest_block_num: BlockNumber,
    },
}

// SYNC NULLIFIERS ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum SyncNullifiersError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("unsupported prefix length: {0} (only 16-bit prefixes are supported)")]
    InvalidPrefixLength(u32),
    #[error("malformed nullifier prefix")]
    DeserializationFailed(#[from] ConversionError),
}

// SYNC ACCOUNT VAULT ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum SyncAccountVaultError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("malformed account ID")]
    DeserializationFailed(#[from] ConversionError),
    #[error("account {0} is not public")]
    AccountNotPublic(AccountId),
}

// SYNC STORAGE MAPS ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum SyncAccountStorageMapsError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("malformed account ID")]
    DeserializationFailed(#[from] ConversionError),
    #[error("account {0} not found")]
    AccountNotFound(AccountId),
    #[error("account {0} is not public")]
    AccountNotPublic(AccountId),
}

// GET NETWORK ACCOUNT IDS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum GetNetworkAccountIdsError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("malformed nullifier prefix")]
    DeserializationFailed(#[from] ConversionError),
}

// GET BLOCK BY NUMBER ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum GetBlockByNumberError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("malformed block number")]
    DeserializationFailed(#[from] DeserializationError),
}

// GET ACCOUNT ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum GetAccountError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("malformed request")]
    DeserializationFailed(#[from] ConversionError),
    #[error("account {0} not found at block {1}")]
    AccountNotFound(AccountId, BlockNumber),
    #[error("account {0} is not public")]
    AccountNotPublic(AccountId),
    #[error("block {0} is unknown")]
    UnknownBlock(BlockNumber),
    #[error("block {0} has been pruned")]
    BlockPruned(BlockNumber),
}

// GET NOTES BY ID ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum GetNotesByIdError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("malformed note ID")]
    DeserializationFailed(#[from] ConversionError),
    #[error("note {0} not found")]
    NoteNotFound(NoteId),
    #[error("note {0} is not public")]
    NoteNotPublic(NoteId),
}

// GET NOTE SCRIPT BY ROOT ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum GetNoteScriptByRootError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("malformed script root")]
    DeserializationFailed(#[from] ConversionError),
    #[error("script with given root not found")]
    ScriptNotFound,
}

// CHECK NULLIFIERS ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum CheckNullifiersError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("malformed nullifier")]
    DeserializationFailed(#[from] ConversionError),
}

// SYNC TRANSACTIONS ERRORS
// ================================================================================================

#[derive(Debug, Error, GrpcError)]
pub enum SyncTransactionsError {
    #[error("database error")]
    #[grpc(internal)]
    DatabaseError(#[from] DatabaseError),
    #[error("invalid block range")]
    InvalidBlockRange(#[from] InvalidBlockRange),
    #[error("malformed account ID")]
    DeserializationFailed(#[from] ConversionError),
    #[error("account {0} not found")]
    AccountNotFound(AccountId),
    #[error("failed to retrieve witness")]
    WitnessError(#[from] WitnessError),
}

#[derive(Debug, Error, GrpcError)]
pub enum GetWitnessesError {
    #[error("malformed request")]
    DeserializationFailed(#[from] ConversionError),
    #[error("failed to retrieve witness")]
    WitnessError(#[from] WitnessError),
}

#[cfg(test)]
mod get_account_error_tests {
    use miden_protocol::account::AccountId;
    use miden_protocol::block::BlockNumber;
    use miden_protocol::testing::account_id::AccountIdBuilder;
    use tonic::Status;

    use super::GetAccountError;

    fn test_account_id() -> AccountId {
        AccountIdBuilder::new().build_with_seed([1; 32])
    }

    #[test]
    fn unknown_block_returns_invalid_argument() {
        let block = BlockNumber::from(999);
        let err = GetAccountError::UnknownBlock(block);
        let status: Status = err.into();
        assert_eq!(status.code(), tonic::Code::InvalidArgument);
        assert!(!status.metadata().is_empty() || !status.details().is_empty());
    }

    #[test]
    fn block_pruned_returns_invalid_argument() {
        let block = BlockNumber::from(1);
        let err = GetAccountError::BlockPruned(block);
        let status: Status = err.into();
        assert_eq!(status.code(), tonic::Code::InvalidArgument);
    }

    #[test]
    fn account_not_public_returns_invalid_argument() {
        let err = GetAccountError::AccountNotPublic(test_account_id());
        let status: Status = err.into();
        assert_eq!(status.code(), tonic::Code::InvalidArgument);
    }

    #[test]
    fn account_not_found_returns_invalid_argument_with_block_context() {
        let account_id = test_account_id();
        let block = BlockNumber::from(5);
        let err = GetAccountError::AccountNotFound(account_id, block);
        let msg = err.to_string();
        assert!(msg.contains("not found"), "error message should mention 'not found'");
        assert!(msg.contains("block"), "error message should include block context");

        let status: Status = err.into();
        assert_eq!(status.code(), tonic::Code::InvalidArgument);
    }

    #[test]
    fn each_variant_has_unique_discriminant() {
        let account_id = test_account_id();
        let block = BlockNumber::from(1);

        let errors = [
            GetAccountError::AccountNotFound(account_id, block),
            GetAccountError::AccountNotPublic(account_id),
            GetAccountError::UnknownBlock(block),
            GetAccountError::BlockPruned(block),
        ];

        let codes: Vec<u8> = errors.iter().map(|e| e.api_error().api_code()).collect();

        // All non-internal variants should have unique, non-zero discriminants
        for &code in &codes {
            assert_ne!(code, 0, "non-internal variants should not map to Internal (0)");
        }

        // Check uniqueness
        let mut sorted = codes.clone();
        sorted.sort_unstable();
        sorted.dedup();
        assert_eq!(sorted.len(), codes.len(), "all error variants should have unique codes");
    }
}

// Do not scope for `cfg(test)` - if it the traitbounds don't suffice the issue will already appear
// in the compilation of the library or binary, which would prevent getting to compiling the
// following code.
mod compile_tests {
    use std::marker::PhantomData;

    use super::{
        AccountDeltaError,
        AccountError,
        DatabaseError,
        DeserializationError,
        NetworkAccountError,
        NoteError,
        RecvError,
        StateInitializationError,
    };

    /// Ensure all enum variants remain compat with the desired
    /// trait bounds. Otherwise one gets very unwieldy errors.
    #[expect(dead_code)]
    fn assumed_trait_bounds_upheld() {
        fn ensure_is_error<E>(_phony: PhantomData<E>)
        where
            E: std::error::Error + Send + Sync + 'static,
        {
        }

        ensure_is_error::<AccountError>(PhantomData);
        ensure_is_error::<AccountDeltaError>(PhantomData);
        ensure_is_error::<RecvError>(PhantomData);
        ensure_is_error::<DeserializationError>(PhantomData);
        ensure_is_error::<NetworkAccountError>(PhantomData);
        ensure_is_error::<NoteError>(PhantomData);
        ensure_is_error::<hex::FromHexError>(PhantomData);
        ensure_is_error::<deadpool::managed::PoolError<deadpool_diesel::Error>>(PhantomData);
        ensure_is_error::<diesel::result::Error>(PhantomData);
        ensure_is_error::<deadpool_diesel::Error>(PhantomData);
        ensure_is_error::<deadpool::managed::RecycleError<deadpool_diesel::Error>>(PhantomData);

        ensure_is_error::<DatabaseError>(PhantomData);
        ensure_is_error::<diesel::result::Error>(PhantomData);
        ensure_is_error::<StateInitializationError>(PhantomData);
        ensure_is_error::<deadpool::managed::PoolError<deadpool_diesel::Error>>(PhantomData);
    }
}