Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the logic of publishing update tx more robust #3046

Open
linked0 opened this issue Feb 15, 2022 · 0 comments
Open

Make the logic of publishing update tx more robust #3046

linked0 opened this issue Feb 15, 2022 · 0 comments
Labels
C. Payment Channel Related to Flash TestNet

Comments

@linked0
Copy link
Contributor

linked0 commented Feb 15, 2022

A flash node sends the latest update tx right after a block containing an update tx is externalized. But there might be some issue that the validator referenced by the node has not yet accepted the block so there might be no UTXO that is referenced by inputs of a new update tx. So we should change the logic that can have a relayer or check that the referenced validator has the same height as the node. This issue was found out when solving issue #2425.

    public void onUpdateTxExternalized (in Transaction tx, in uint utxo_idx, in bool is_last)
    {
        this.state = ChannelState.StartedUnilateralClose;
        this.onChannelNotify(this.own_pk, this.conf.chan_id, this.state,
            ErrorCode.None);


        this.last_externalized_update_utxo = UTXO.getHash(tx.hashFull(), utxo_idx);
        if (is_last)
        {
            this.state = ChannelState.WaitingOnSettlement;
            this.onChannelNotify(this.own_pk, this.conf.chan_id, this.state,
                ErrorCode.None);
            this.update_ext_height = this.height;
        }
        else
        {
            this.publishUpdateTx(this.channel_updates[$ - 1]);
        }
    }
@linked0 linked0 added the C. Payment Channel Related to Flash TestNet label Feb 15, 2022
@linked0 linked0 added this to the 6. Stabilization milestone Feb 15, 2022
@linked0 linked0 changed the title Make the logic publishing update tx more robust Make the logic of publishing update tx more robust Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C. Payment Channel Related to Flash TestNet
Projects
None yet
Development

No branches or pull requests

2 participants
@linked0 and others