Page MenuHomePhabricator

[avalanche] Add a RPC to check if a block/tx is finalized by avalanche
ClosedPublic

Authored by Fabien on Sep 15 2022, 15:31.

Details

Summary

This will make it easier for exchanges to implement 1-block confirmation.

Test Plan

With clang and debug:

ninja all check-all

Run the ASAN and TSAN builds.

Diff Detail

Event Timeline

Fabien requested review of this revision.Sep 15 2022, 15:31
sdulfari requested changes to this revision.Sep 15 2022, 15:47
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/rpc/avalanche.cpp
1042 ↗(On Diff #34989)

Examples are missing <blockhash>

1055 ↗(On Diff #34989)

blockhash isn't optional, but the tests don't test for the case where this is null

1072 ↗(On Diff #34989)

The mempool check isn't needed if blockhash is required.

This revision now requires changes to proceed.Sep 15 2022, 15:47

Add txindex support, add a few safety null check

sdulfari requested changes to this revision.Sep 15 2022, 16:45
sdulfari added inline comments.
src/validation.cpp
3492

needs to exit early on nullptr

test/functional/abc_rpc_isfinal.py
108

nit: from here down, "mempool_txid" isn't in the mempool, so the naming is confusing

This revision now requires changes to proceed.Sep 15 2022, 16:45
This revision is now accepted and ready to land.Sep 15 2022, 16:50
This revision was landed with ongoing or failed builds.Sep 15 2022, 16:56
This revision was automatically updated to reflect the committed changes.