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

OP: validate num_pub_rand in handle_public_randomness_commit() #20

Open
maurolacy opened this issue Jul 31, 2024 · 1 comment
Open

OP: validate num_pub_rand in handle_public_randomness_commit() #20

maurolacy opened this issue Jul 31, 2024 · 1 comment

Comments

@maurolacy
Copy link
Collaborator

@bap2pecs cloned issue babylonchain/babylon-contract#186 on 2024-06-23:

in FP, we will add logic in fast sync:


		for lastCommitStartHeight, val := range lastCommitPR {

			if endHeight > lastCommitStartHeight+val.NumPubRand-1 {

				return nil, nil

			}

		}

if both lastCommitStartHeight and val.NumPubRand is 0, integer underflow can happen.

but in reality, we shouldn't allow NumPubRand to be 0. it should at least have 1 pubrand.

we should enforce this check in the CW contract

@maurolacy
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant