• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari / 18684123493

21 Oct 2025 12:40PM UTC coverage: 59.549% (+1.0%) from 58.577%
18684123493

push

github

web-flow
chore(deps): bump azure/trusted-signing-action from 0.5.9 to 0.5.10 (#7551)

Bumps
[azure/trusted-signing-action](https://github.com/azure/trusted-signing-action)
from 0.5.9 to 0.5.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/azure/trusted-signing-action/releases">azure/trusted-signing-action's
releases</a>.</em></p>
<blockquote>
<h2>v0.5.10</h2>
<h2>What's Changed</h2>
<ul>
<li>Update README.md by <a
href="https://github.com/Jaxelr"><code>@​Jaxelr</code></a> in <a
href="https://redirect.github.com/Azure/trusted-signing-action/pull/87">Azure/trusted-signing-action#87</a></li>
<li>docs: added clause indicating support for windows-2025 by <a
href="https://github.com/Jaxelr"><code>@​Jaxelr</code></a> in <a
href="https://redirect.github.com/Azure/trusted-signing-action/pull/89">Azure/trusted-signing-action#89</a></li>
<li>Pin actions/cache by Git SHA by <a
href="https://github.com/martincostello"><code>@​martincostello</code></a>
in <a
href="https://redirect.github.com/Azure/trusted-signing-action/pull/90">Azure/trusted-signing-action#90</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Jaxelr"><code>@​Jaxelr</code></a> made
their first contribution in <a
href="https://redirect.github.com/Azure/trusted-signing-action/pull/87">Azure/trusted-signing-action#87</a></li>
<li><a
href="https://github.com/martincostello"><code>@​martincostello</code></a>
made their first contribution in <a
href="https://redirect.github.com/Azure/trusted-signing-action/pull/90">Azure/trusted-signing-action#90</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Azure/trusted-signing-action/compare/v0.5...v0.5.10">https://github.com/Azure/trusted-signing-action/compare/v0.5...v0.5.10</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Azure/trusted-signing-action/commit/fc390cf8e"><code>fc390cf<... (continued)

67595 of 113511 relevant lines covered (59.55%)

304632.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/base_layer/core/src/base_node/rpc/query_service.rs
1
// Copyright 2025 The Tari Project
2
// SPDX-License-Identifier: BSD-3-Clause
3

4
use std::cmp;
5

6
use log::trace;
7
use serde_valid::{validation, Validate};
8
use tari_common_types::{
9
    types,
10
    types::{FixedHash, FixedHashSizeError},
11
};
12
use tari_transaction_components::{
13
    rpc::{
14
        models,
15
        models::{
16
            BlockUtxoInfo,
17
            GenerateKernelMerkleProofResponse,
18
            GetUtxosByBlockRequest,
19
            GetUtxosByBlockResponse,
20
            MinimalUtxoSyncInfo,
21
            SyncUtxosByBlockRequest,
22
            SyncUtxosByBlockResponse,
23
            TipInfoResponse,
24
            TxLocation,
25
            TxQueryResponse,
26
        },
27
    },
28
    transaction_components::TransactionOutput,
29
};
30
use tari_utilities::{hex::Hex, ByteArray, ByteArrayError};
31
use thiserror::Error;
32

33
use crate::{
34
    base_node::{rpc::BaseNodeWalletQueryService, state_machine_service::states::StateInfo, StateMachineHandle},
35
    chain_storage::{async_db::AsyncBlockchainDb, BlockchainBackend, ChainStorageError},
36
    mempool::{service::MempoolHandle, MempoolServiceError, TxStorageResponse},
37
};
38

39
const LOG_TARGET: &str = "c::bn::rpc::query_service";
40
const SYNC_UTXOS_SPEND_TIP_SAFETY_LIMIT: u64 = 1000;
41

42
#[derive(Debug, Error)]
43
pub enum Error {
44
    #[error("Failed to get chain metadata: {0}")]
45
    FailedToGetChainMetadata(#[from] ChainStorageError),
46
    #[error("Header not found at height: {height}")]
47
    HeaderNotFound { height: u64 },
48
    #[error("Signature conversion error: {0}")]
49
    SignatureConversion(ByteArrayError),
50
    #[error("Mempool service error: {0}")]
51
    MempoolService(#[from] MempoolServiceError),
52
    #[error("Serde validation error: {0}")]
53
    SerdeValidation(#[from] validation::Errors),
54
    #[error("Hash conversion error: {0}")]
55
    HashConversion(#[from] FixedHashSizeError),
56
    #[error("Start header hash not found")]
57
    StartHeaderHashNotFound,
58
    #[error("End header hash not found")]
59
    EndHeaderHashNotFound,
60
    #[error("Header hash not found")]
61
    HeaderHashNotFound,
62
    #[error("Start header height {start_height} cannot be greater than the end header height {end_height}")]
63
    HeaderHeightMismatch { start_height: u64, end_height: u64 },
64
    #[error("A general error occurred: {0}")]
65
    General(anyhow::Error),
66
}
67

68
impl Error {
69
    fn general(err: impl Into<anyhow::Error>) -> Self {
×
70
        Error::General(err.into())
×
71
    }
×
72
}
73

74
pub struct Service<B> {
75
    db: AsyncBlockchainDb<B>,
76
    state_machine: StateMachineHandle,
77
    mempool: MempoolHandle,
78
}
79

80
impl<B: BlockchainBackend + 'static> Service<B> {
81
    pub fn new(db: AsyncBlockchainDb<B>, state_machine: StateMachineHandle, mempool: MempoolHandle) -> Self {
×
82
        Self {
×
83
            db,
×
84
            state_machine,
×
85
            mempool,
×
86
        }
×
87
    }
×
88

89
    fn state_machine(&self) -> StateMachineHandle {
×
90
        self.state_machine.clone()
×
91
    }
×
92

93
    fn db(&self) -> &AsyncBlockchainDb<B> {
×
94
        &self.db
×
95
    }
×
96

97
    fn mempool(&self) -> MempoolHandle {
×
98
        self.mempool.clone()
×
99
    }
×
100

101
    async fn fetch_kernel(&self, signature: types::CompressedSignature) -> Result<TxQueryResponse, Error> {
×
102
        let db = self.db();
×
103

104
        match db.fetch_kernel_by_excess_sig(signature.clone()).await? {
×
105
            None => (),
×
106
            Some((_, block_hash)) => match db.fetch_header_by_block_hash(block_hash).await? {
×
107
                None => (),
×
108
                Some(header) => {
×
109
                    let response = TxQueryResponse {
×
110
                        location: TxLocation::Mined,
×
111
                        mined_header_hash: Some(block_hash.to_vec()),
×
112
                        mined_height: Some(header.height),
×
113
                        mined_timestamp: Some(header.timestamp.as_u64()),
×
114
                    };
×
115
                    return Ok(response);
×
116
                },
117
            },
118
        };
119

120
        // If not in a block then check the mempool
121
        let mut mempool = self.mempool();
×
122
        let mempool_response = match mempool.get_tx_state_by_excess_sig(signature.clone()).await? {
×
123
            TxStorageResponse::UnconfirmedPool => TxQueryResponse {
×
124
                location: TxLocation::InMempool,
×
125
                mined_header_hash: None,
×
126
                mined_height: None,
×
127
                mined_timestamp: None,
×
128
            },
×
129
            TxStorageResponse::ReorgPool |
130
            TxStorageResponse::NotStoredOrphan |
131
            TxStorageResponse::NotStoredTimeLocked |
132
            TxStorageResponse::NotStoredAlreadySpent |
133
            TxStorageResponse::NotStoredConsensus |
134
            TxStorageResponse::NotStored |
135
            TxStorageResponse::NotStoredFeeTooLow |
136
            TxStorageResponse::NotStoredAlreadyMined => TxQueryResponse {
×
137
                location: TxLocation::NotStored,
×
138
                mined_timestamp: None,
×
139
                mined_height: None,
×
140
                mined_header_hash: None,
×
141
            },
×
142
        };
143

144
        Ok(mempool_response)
×
145
    }
×
146

147
    async fn fetch_utxos_by_block(&self, request: GetUtxosByBlockRequest) -> Result<GetUtxosByBlockResponse, Error> {
×
148
        request.validate()?;
×
149

150
        let hash = request.header_hash.clone().try_into()?;
×
151

152
        let header = self
×
153
            .db()
×
154
            .fetch_header_by_block_hash(hash)
×
155
            .await?
×
156
            .ok_or_else(|| Error::HeaderHashNotFound)?;
×
157

158
        // fetch utxos
159
        let outputs_with_statuses = self.db.fetch_outputs_in_block_with_spend_state(hash, None).await?;
×
160

161
        let outputs = outputs_with_statuses
×
162
            .into_iter()
×
163
            .map(|(output, _spent)| output)
×
164
            .collect::<Vec<TransactionOutput>>();
×
165

166
        // if its empty, we need to send an empty vec of outputs.
167
        let utxo_block_response = GetUtxosByBlockResponse {
×
168
            outputs,
×
169
            height: header.height,
×
170
            header_hash: hash.to_vec(),
×
171
            mined_timestamp: header.timestamp.as_u64(),
×
172
        };
×
173

174
        Ok(utxo_block_response)
×
175
    }
×
176

177
    #[allow(clippy::too_many_lines)]
178
    async fn fetch_utxos(&self, request: SyncUtxosByBlockRequest) -> Result<SyncUtxosByBlockResponse, Error> {
×
179
        // validate and fetch inputs
180
        request.validate()?;
×
181

182
        let hash = request.start_header_hash.clone().try_into()?;
×
183

184
        let start_header = self
×
185
            .db()
×
186
            .fetch_header_by_block_hash(hash)
×
187
            .await?
×
188
            .ok_or_else(|| Error::StartHeaderHashNotFound)?;
×
189

190
        let tip_header = self.db.fetch_tip_header().await?;
×
191
        // we only allow wallets to ask for a max of 100 blocks at a time and we want to cache the queries to ensure
192
        // they are in batch of 100 and we want to ensure they request goes to the nearest 100 block height so
193
        // we can cache all wallet's queries
194
        let increase = ((start_header.height + 100) / 100) * 100;
×
195
        let end_height = cmp::min(tip_header.header().height, increase);
×
196

197
        // pagination
198
        let start_header_height = start_header.height + (request.page * request.limit);
×
199
        if start_header_height > tip_header.header().height {
×
200
            return Err(Error::HeaderHeightMismatch {
×
201
                start_height: start_header.height,
×
202
                end_height: tip_header.header().height,
×
203
            });
×
204
        }
×
205
        let start_header = self
×
206
            .db
×
207
            .fetch_header(start_header_height)
×
208
            .await?
×
209
            .ok_or_else(|| Error::HeaderNotFound {
×
210
                height: start_header_height,
×
211
            })?;
×
212

213
        // fetch utxos
214
        let mut utxos = vec![];
×
215
        let mut current_header = start_header;
×
216
        let mut fetched_utxos = 0;
×
217
        let spending_end_header_hash = self
×
218
            .db
×
219
            .fetch_header(
×
220
                tip_header
×
221
                    .header()
×
222
                    .height
×
223
                    .saturating_sub(SYNC_UTXOS_SPEND_TIP_SAFETY_LIMIT),
×
224
            )
×
225
            .await?
×
226
            .ok_or_else(|| Error::HeaderNotFound {
×
227
                height: tip_header
×
228
                    .header()
×
229
                    .height
×
230
                    .saturating_sub(SYNC_UTXOS_SPEND_TIP_SAFETY_LIMIT),
×
231
            })?
×
232
            .hash();
×
233
        let next_header_to_request;
234
        loop {
235
            let current_header_hash = current_header.hash();
×
236

237
            trace!(
×
238
                target: LOG_TARGET,
×
239
                "current header = {} ({})",
×
240
                current_header.height,
241
                current_header_hash.to_hex()
×
242
            );
243
            let outputs = if request.exclude_spent {
×
244
                self.db
×
245
                    .fetch_outputs_in_block_with_spend_state(current_header_hash, Some(spending_end_header_hash))
×
246
                    .await?
×
247
                    .into_iter()
×
248
                    .filter(|(_, spent)| !spent)
×
249
                    .map(|(output, _spent)| output)
×
250
                    .collect::<Vec<TransactionOutput>>()
×
251
            } else {
252
                self.db
×
253
                    .fetch_outputs_in_block_with_spend_state(current_header_hash, None)
×
254
                    .await?
×
255
                    .into_iter()
×
256
                    .map(|(output, _spent)| output)
×
257
                    .collect::<Vec<TransactionOutput>>()
×
258
            };
259
            let mut inputs = self
×
260
                .db
×
261
                .fetch_inputs_in_block(current_header_hash)
×
262
                .await?
×
263
                .into_iter()
×
264
                .map(|input| input.output_hash())
×
265
                .collect::<Vec<FixedHash>>();
×
266

267
            for output_chunk in outputs.chunks(2000) {
×
268
                let inputs_to_send = if inputs.is_empty() {
×
269
                    Vec::new()
×
270
                } else {
271
                    let num_to_drain = inputs.len().min(2000);
×
272
                    inputs.drain(..num_to_drain).map(|h| h.to_vec()).collect()
×
273
                };
274

275
                let output_block_response = BlockUtxoInfo {
×
276
                    outputs: output_chunk
×
277
                        .iter()
×
278
                        .map(|output| MinimalUtxoSyncInfo {
×
279
                            output_hash: output.hash().to_vec(),
×
280
                            commitment: output.commitment().to_vec(),
×
281
                            encrypted_data: output.encrypted_data().as_bytes().to_vec(),
×
282
                            sender_offset_public_key: output.sender_offset_public_key.to_vec(),
×
283
                        })
×
284
                        .collect(),
×
285
                    inputs: inputs_to_send,
×
286
                    height: current_header.height,
×
287
                    header_hash: current_header_hash.to_vec(),
×
288
                    mined_timestamp: current_header.timestamp.as_u64(),
×
289
                };
290
                utxos.push(output_block_response);
×
291
            }
292
            // We might still have inputs left to send if they are more than the outputs
293
            for input_chunk in inputs.chunks(2000) {
×
294
                let output_block_response = BlockUtxoInfo {
×
295
                    outputs: Vec::new(),
×
296
                    inputs: input_chunk.iter().map(|h| h.to_vec()).collect::<Vec<_>>().to_vec(),
×
297
                    height: current_header.height,
×
298
                    header_hash: current_header_hash.to_vec(),
×
299
                    mined_timestamp: current_header.timestamp.as_u64(),
×
300
                };
301
                utxos.push(output_block_response);
×
302
            }
303

304
            fetched_utxos += 1;
×
305

306
            if current_header.height >= tip_header.header().height {
×
307
                next_header_to_request = vec![];
×
308
                break;
×
309
            }
×
310
            if fetched_utxos >= request.limit {
×
311
                next_header_to_request = current_header_hash.to_vec();
×
312
                // This is a special edge case, our request has reached the page limit, but we are also not done with
313
                // the block. We also dont want to split up the block over two requests. So we need to ensure that we
314
                // remove the partial block we added so that it can be requested fully in the next request. We also dont
315
                // want to get in a loop where the block cannot fit into the page limit, so if the block is the same as
316
                // the first one, we just send it as is, partial. If not we remove it and let it be sent in the next
317
                // request.
318
                if utxos.first().ok_or(Error::General(anyhow::anyhow!("No utxos founds")))? // should never happen as we always add at least one block
×
319
                    .header_hash ==
320
                    current_header_hash.to_vec()
×
321
                {
322
                    // special edge case where the first block is also the last block we can send, so we just send it as
323
                    // is, partial
324
                    break;
×
325
                }
×
326
                while !utxos.is_empty() &&
×
327
                    utxos.last().ok_or(Error::General(anyhow::anyhow!("No utxos found")))? // should never happen as we always add at least one block
×
328
                    .header_hash ==
329
                        current_header_hash.to_vec()
×
330
                {
×
331
                    utxos.pop();
×
332
                }
×
333
                break;
×
334
            }
×
335

336
            current_header =
×
337
                self.db
×
338
                    .fetch_header(current_header.height + 1)
×
339
                    .await?
×
340
                    .ok_or_else(|| Error::HeaderNotFound {
×
341
                        height: current_header.height + 1,
×
342
                    })?;
×
343
            if current_header.height == end_height {
×
344
                next_header_to_request = current_header.hash().to_vec();
×
345
                break; // Stop if we reach the end height}
×
346
            }
×
347
        }
348

349
        let has_next_page = (end_height.saturating_sub(current_header.height)) > 0;
×
350

351
        Ok(SyncUtxosByBlockResponse {
×
352
            blocks: utxos,
×
353
            has_next_page,
×
354
            next_header_to_scan: next_header_to_request,
×
355
        })
×
356
    }
×
357
}
358

359
#[async_trait::async_trait]
360
impl<B: BlockchainBackend + 'static> BaseNodeWalletQueryService for Service<B> {
361
    type Error = Error;
362

363
    async fn get_tip_info(&self) -> Result<TipInfoResponse, Self::Error> {
×
364
        let state_machine = self.state_machine();
×
365
        let status_watch = state_machine.get_status_info_watch();
×
366
        let is_synced = match status_watch.borrow().state_info {
×
367
            StateInfo::Listening(li) => li.is_synced(),
×
368
            _ => false,
×
369
        };
370

371
        let metadata = self.db.get_chain_metadata().await?;
×
372

373
        Ok(TipInfoResponse {
×
374
            metadata: Some(metadata),
×
375
            is_synced,
×
376
        })
×
377
    }
×
378

379
    async fn get_header_by_height(&self, height: u64) -> Result<models::BlockHeader, Self::Error> {
×
380
        let result = self
×
381
            .db
×
382
            .fetch_header(height)
×
383
            .await?
×
384
            .ok_or(Error::HeaderNotFound { height })?
×
385
            .into();
×
386
        Ok(result)
×
387
    }
×
388

389
    async fn get_height_at_time(&self, epoch_time: u64) -> Result<u64, Self::Error> {
×
390
        trace!(target: LOG_TARGET, "requested_epoch_time: {}", epoch_time);
×
391
        let tip_header = self.db.fetch_tip_header().await?;
×
392

393
        let mut left_height = 0u64;
×
394
        let mut right_height = tip_header.height();
×
395

396
        while left_height <= right_height {
×
397
            let mut mid_height = (left_height + right_height) / 2;
×
398

399
            if mid_height == 0 {
×
400
                return Ok(0u64);
×
401
            }
×
402
            // If the two bounds are adjacent then perform the test between the right and left sides
403
            if left_height == mid_height {
×
404
                mid_height = right_height;
×
405
            }
×
406

407
            let mid_header = self
×
408
                .db
×
409
                .fetch_header(mid_height)
×
410
                .await?
×
411
                .ok_or_else(|| Error::HeaderNotFound { height: mid_height })?;
×
412
            let before_mid_header = self
×
413
                .db
×
414
                .fetch_header(mid_height - 1)
×
415
                .await?
×
416
                .ok_or_else(|| Error::HeaderNotFound { height: mid_height - 1 })?;
×
417
            trace!(
×
418
                target: LOG_TARGET,
×
419
                "requested_epoch_time: {}, left: {}, mid: {}/{} ({}/{}), right: {}",
×
420
                epoch_time,
421
                left_height,
422
                mid_height,
423
                mid_height-1,
×
424
                mid_header.timestamp.as_u64(),
×
425
                before_mid_header.timestamp.as_u64(),
×
426
                right_height
427
            );
428
            if epoch_time < mid_header.timestamp.as_u64() && epoch_time >= before_mid_header.timestamp.as_u64() {
×
429
                trace!(
×
430
                    target: LOG_TARGET,
×
431
                    "requested_epoch_time: {}, selected height: {}",
×
432
                    epoch_time, before_mid_header.height
433
                );
434
                return Ok(before_mid_header.height);
×
435
            } else if mid_height == right_height {
×
436
                trace!(
×
437
                    target: LOG_TARGET,
×
438
                    "requested_epoch_time: {epoch_time}, selected height: {right_height}"
×
439
                );
440
                return Ok(right_height);
×
441
            } else if epoch_time <= mid_header.timestamp.as_u64() {
×
442
                right_height = mid_height;
×
443
            } else {
×
444
                left_height = mid_height;
×
445
            }
×
446
        }
447

448
        Ok(0u64)
×
449
    }
×
450

451
    async fn transaction_query(
452
        &self,
453
        signature: crate::base_node::rpc::models::Signature,
454
    ) -> Result<TxQueryResponse, Self::Error> {
×
455
        let signature = signature.try_into().map_err(Error::SignatureConversion)?;
×
456

457
        let response = self.fetch_kernel(signature).await?;
×
458

459
        Ok(response)
×
460
    }
×
461

462
    async fn sync_utxos_by_block(
463
        &self,
464
        request: SyncUtxosByBlockRequest,
465
    ) -> Result<SyncUtxosByBlockResponse, Self::Error> {
×
466
        self.fetch_utxos(request).await
×
467
    }
×
468

469
    async fn get_utxos_by_block(
470
        &self,
471
        request: GetUtxosByBlockRequest,
472
    ) -> Result<GetUtxosByBlockResponse, Self::Error> {
×
473
        self.fetch_utxos_by_block(request).await
×
474
    }
×
475

476
    async fn get_utxos_mined_info(
477
        &self,
478
        request: models::GetUtxosMinedInfoRequest,
479
    ) -> Result<models::GetUtxosMinedInfoResponse, Self::Error> {
×
480
        request.validate()?;
×
481

482
        let mut utxos = vec![];
×
483

484
        let tip_header = self.db().fetch_tip_header().await?;
×
485
        for hash in request.hashes {
×
486
            let hash = hash.try_into()?;
×
487
            let output = self.db().fetch_output(hash).await?;
×
488
            if let Some(output) = output {
×
489
                utxos.push(models::MinedUtxoInfo {
×
490
                    utxo_hash: hash.to_vec(),
×
491
                    mined_in_hash: output.header_hash.to_vec(),
×
492
                    mined_in_height: output.mined_height,
×
493
                    mined_in_timestamp: output.mined_timestamp,
×
494
                });
×
495
            }
×
496
        }
497

498
        Ok(models::GetUtxosMinedInfoResponse {
×
499
            utxos,
×
500
            best_block_hash: tip_header.hash().to_vec(),
×
501
            best_block_height: tip_header.height(),
×
502
        })
×
503
    }
×
504

505
    async fn get_utxos_deleted_info(
506
        &self,
507
        request: models::GetUtxosDeletedInfoRequest,
508
    ) -> Result<models::GetUtxosDeletedInfoResponse, Self::Error> {
×
509
        request.validate()?;
×
510

511
        let mut utxos = vec![];
×
512

513
        let must_include_header = request.must_include_header.clone().try_into()?;
×
514
        if self
×
515
            .db()
×
516
            .fetch_header_by_block_hash(must_include_header)
×
517
            .await?
×
518
            .is_none()
×
519
        {
520
            return Err(Error::HeaderHashNotFound);
×
521
        }
×
522

523
        let tip_header = self.db().fetch_tip_header().await?;
×
524
        for hash in request.hashes {
×
525
            let hash = hash.try_into()?;
×
526
            let output = self.db().fetch_output(hash).await?;
×
527

528
            if let Some(output) = output {
×
529
                // is it still unspent?
530
                let input = self.db().fetch_input(hash).await?;
×
531
                if let Some(i) = input {
×
532
                    utxos.push(models::DeletedUtxoInfo {
×
533
                        utxo_hash: hash.to_vec(),
×
534
                        found_in_header: Some((output.mined_height, output.header_hash.to_vec())),
×
535
                        spent_in_header: Some((i.spent_height, i.header_hash.to_vec())),
×
536
                    });
×
537
                } else {
×
538
                    utxos.push(models::DeletedUtxoInfo {
×
539
                        utxo_hash: hash.to_vec(),
×
540
                        found_in_header: Some((output.mined_height, output.header_hash.to_vec())),
×
541
                        spent_in_header: None,
×
542
                    });
×
543
                }
×
544
            } else {
×
545
                utxos.push(models::DeletedUtxoInfo {
×
546
                    utxo_hash: hash.to_vec(),
×
547
                    found_in_header: None,
×
548
                    spent_in_header: None,
×
549
                });
×
550
            }
×
551
        }
552

553
        Ok(models::GetUtxosDeletedInfoResponse {
×
554
            utxos,
×
555
            best_block_hash: tip_header.hash().to_vec(),
×
556
            best_block_height: tip_header.height(),
×
557
        })
×
558
    }
×
559

560
    async fn generate_kernel_merkle_proof(
561
        &self,
562
        excess_sig: types::CompressedSignature,
563
    ) -> Result<GenerateKernelMerkleProofResponse, Self::Error> {
×
564
        let proof = self.db().generate_kernel_merkle_proof(excess_sig).await?;
×
565
        Ok(GenerateKernelMerkleProofResponse {
566
            encoded_merkle_proof: bincode::serialize(&proof.merkle_proof).map_err(Error::general)?,
×
567
            block_hash: proof.block_hash,
×
568
            leaf_index: proof.leaf_index.value() as u64,
×
569
        })
570
    }
×
571
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc