trilitech / ledger-app-tezos-baking

Tezos Baking app for Ledger Devices
Apache License 2.0
0 stars 1 forks source link

Unauthorized to sign block at reset level #22

Closed spalmer25 closed 8 months ago

spalmer25 commented 9 months ago

Currently, the app cannot sign block at reset level.

Is this an expected behaviour ?

See: https://github.com/trilitech/ledger-app-tezos-baking/pull/18#discussion_r1474029889

spalmer25 commented 9 months ago

Accusing

Here is my understanding of when an operation/block can be accused:

Operations

If an accuser retrieves, at any time, from the same attester, two attestations (resp. two pre-attestations) with :

Then the accuser can accuse the attester with a Double Attestation Evidence (resp. Double Pre-Attestation Evidence).

This happens no matter if the accuser retrieves the operation from the mempool or from a block.

Block

If an accuser retrieves, at any time, from the same baker, two block with :

Then the accuser can accuse the baker with a Double Baking Evidence.

In our app

We choose : 1) to only check chain_id, level and round :

See baking_auth.c

Each condition reduction, which we apply with 1., 2., 3. and 4., continues to prevent signing non-valid operations/blocks but also prevents signing valid operations/blocks.

The issue we encounter is because of the rules 4.i: When we reset the level, we set the chain_id/level/round. So by the rule 4.iii, we can't sign a block to that same chain_id/level/round.

Do we want to stick with each of these condition reductions as they currently stand?

spalmer25 commented 9 months ago

Proposal: Change 4.iii into:

spalmer25 commented 9 months ago

Proposal: Keep the conditions as they are, but prevent signing at the same level as the reset (whatever the round). This implicitly implies the previous proposal.

spalmer25 commented 8 months ago

Final decision: Do not change the current behaviour, as the baker most often resets at level 0 and does not bake at level 0.