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

Contracts/Revive: caller_is_root does not return bool #6767

Open
2 tasks done
cmichi opened this issue Dec 5, 2024 · 1 comment
Open
2 tasks done

Contracts/Revive: caller_is_root does not return bool #6767

cmichi opened this issue Dec 5, 2024 · 1 comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@cmichi
Copy link

cmichi commented Dec 5, 2024

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

In both pallet-revive + pallet-contracts the host fn caller_is_root returns u32, opposed as to what the comments state (bool):

/// A return value of `true` indicates that this contract is being called by a root origin,
/// and `false` indicates that the caller is a signed origin.
fn caller_is_root() -> u32;

The analog function caller_is_origin returns bool for everything.

The host fn has already been stabilized for pallet-contracts and also implemented this way in hyperledger-solang/solang#1620 (cc @xermicus). So changing it for pallet-contracts is probably tricky, for pallet-revive it would be good though.

cc @athei

Steps to reproduce

No response

@cmichi cmichi added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 5, 2024
@athei
Copy link
Member

athei commented Dec 5, 2024

This is just the uapi wrapper which returns the wrong type. The host function itself will always return 1 or 0 in the output register. This can be changed easily. Just an oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants