Skip to content

spv validation using chain work instead of block height #2668

@mariocynicys

Description

@mariocynicys

In SPV validation for lightning, we query electurms to find the most synced one and use the block height of it as our target block height. We determine the "most synced" by having the greatest block height.

We might have a bad electrum on a forked chain that has larger block count but less overall work, by consensus, such chain isn't the correct chain.

https://github.com/KomodoPlatform/komodo-defi-framework/blob/c1175ceddb2db4c8e7948b6c764bfd53aea1f8c0/mm2src/coins/utxo/rpc_clients/electrum_rpc/client.rs#L813-L816

We should be able to rule out such electrums and remove them from our connection list.

Relevant convo: #2666 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvement: securityImprovements made on runtime securitypriority: lowTasks with low importance that can be addressed when time permits.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions