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

pick nonce based on atx chain instead of the latest for identity #5701

Open
dshulyak opened this issue Mar 14, 2024 · 0 comments
Open

pick nonce based on atx chain instead of the latest for identity #5701

dshulyak opened this issue Mar 14, 2024 · 0 comments
Labels

Comments

@dshulyak
Copy link
Contributor

dshulyak commented Mar 14, 2024

when you sync a node you will see errors like that

2024-03-14T06:59:58.749Z INFO node.sync remaining ballots are rejected in the layer {"sessionId": "f411b333", "errmsg": "getting ballots: batch failure: 206106e59f=fetch ballots: batch failure: 1327b292db=validation reject: proof contains incorrect VRF signature. beacon: 9e188385, epoch: 4, counter: 0, vrfSig: 91ea700ce79adc13e97333400fbd520b4e5517819e6c96c29f2f47c35b0a45ccfe961a4ae263288b113553e50ba0156fe238e61b87bd3094e5a674ddcf71ab62734ca4d754b33eee7fb629712c577f0a", "layer_id": 19061, "name": "sync"}

the main part here is

proof contains incorrect VRF

which only can be for two reasons:

  • somebody actually computed incorrect vrf - very unlikely
  • we are using wrong nonce from equivocating atx for this validation

this 2nd root cause can be eliminated if we look up vrf nonce based on atx chain, and not just latest nonce for this identity.
reasonable way would be to copy nonce from previous atx when new atx is received, this will also simplify nonce lookups on startup.

more precisely, this is the query that we use to get nonce for identity:

select nonce from atxs
		where pubkey = ?1 and epoch < ?2 and nonce is not null
		order by epoch desc
		limit 1;

if identity equivocated this will not return correct nonce for identity, in the end all of this should be prunable, but now we need to fix this issue, as it will lead to stuck sync if honest identities references ballot from equivocated identity.

@dshulyak dshulyak changed the title pick nonce for atx and not for identity pick nonce based on atx chain and not for identity Mar 14, 2024
@dshulyak dshulyak changed the title pick nonce based on atx chain and not for identity pick nonce based on atx chain and not the latest for identity Mar 14, 2024
@dshulyak dshulyak changed the title pick nonce based on atx chain and not the latest for identity pick nonce based on atx chain instead of the latest for identity Mar 14, 2024
spacemesh-bors bot pushed a commit that referenced this issue Mar 22, 2024
…5761)

related: #5701

in the implementation sync loop will repeatedly asks for objects even if it can't process them.
in this pr we allow sync to make progress if the remaining objects in the layer can't be processed with retries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🔖 Next
Development

Successfully merging a pull request may close this issue.

1 participant