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

Illegal argument error when calling block.difficulty #1648

Closed
maciejwitowski opened this issue Feb 7, 2023 · 3 comments · Fixed by filecoin-project/lotus#10216
Closed

Illegal argument error when calling block.difficulty #1648

maciejwitowski opened this issue Feb 7, 2023 · 3 comments · Fixed by filecoin-project/lotus#10216
Assignees

Comments

@maciejwitowski
Copy link
Contributor

This was found as part of the Bulletproofing program

Calling this function

function getDifficulty () public view returns (uint256) {
  return block.difficulty;
}

produces this error

"message": "failed to apply message: message execution failed: exit 24, msg receipt: , reason: message failed with backtrace:\n00: f010866 (method 3844450837) -- get beacon randomness failed with an unexpected error: illegal argument (24)\n--> caused by: rand::get_beacon_randomness -- cgo extern 'get_beacon_randomness' failed with error code -3 (1: illegal argument)\n (RetCode=24)"

@maciejwitowski
Copy link
Contributor Author

When I'm getting this error in Remix my local lotus shows this error

ERROR rand rand/rand.go:164 failed to get beacon entry as expected: cannot draw randomness from the future

@Stebalien
Copy link
Member

Should be fixed by filecoin-project/lotus#10216, but I haven't tested it.

@Stebalien
Copy link
Member

Basically, when estimating gas and testing messages, we were passing a chain height in the future with the wrong tipset.

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

Successfully merging a pull request may close this issue.

3 participants