Closed spalmer25 closed 8 months ago
Here is my understanding of when an operation/block can be accused:
If an accuser
retrieves, at any time, from the same attester
, two attestations
(resp. two pre-attestations
) with :
chain_id
, level
and round
andpayload_hash
, slot
or branch
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
.
If an accuser
retrieves, at any time, from the same baker
, two block
with :
chain_id
, level
and round
andhash
Then the accuser
can accuse the baker
with a Double Baking Evidence
.
We choose :
1) to only check chain_id
, level
and round
:
operations
/blocks
.operations
/blocks
from the same chain_id
, level
and round
.
2) to only keep one chain_id
: see https://github.com/trilitech/ledger-app-tezos-baking/issues/19.
3) from a same chain_id
, to check if the level
/round
is not lower than the last level
/round
seen :level
/round
without authorizing non-valid operations
/blocks
.operations
/blocks
that are still valid.
4) from a same chain_id
/level
/round
, to prevent :
1) signing an attestation
if another attestation
has already been seen.
2) signing a pre-attestation
if another pre-attestation
or an attestation
has already been seen.
3) signing a block
.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?
Proposal:
Change 4.iii
into:
prevent signing a block
if another block
or an attestation
/pre-attestation
has already been seen.
Implementation: https://github.com/trilitech/ledger-app-tezos-baking/pull/30
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.
Final decision: Do not change the current behaviour, as the baker most often resets at level 0 and does not bake at level 0.
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