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

_parseCBORUint failing in _decodeReceiptUndelegateStart #323

Open
CedarMist opened this issue Jun 27, 2024 · 3 comments · May be fixed by #325
Open

_parseCBORUint failing in _decodeReceiptUndelegateStart #323

CedarMist opened this issue Jun 27, 2024 · 3 comments · May be fixed by #325
Assignees
Labels
contracts Pull requests that update sapphire-contracts p:1 Priority: high s:underway Status: a patch is in progress solidity

Comments

@CedarMist
Copy link
Member

The consensusTakeReceiptUndelegateStart function in Subcall.sol is failing on testnet with the InvalidLength error.

@CedarMist CedarMist added p:1 Priority: high s:underway Status: a patch is in progress contracts Pull requests that update sapphire-contracts solidity labels Jun 27, 2024
@CedarMist CedarMist self-assigned this Jun 27, 2024
@CedarMist
Copy link
Member Author

The problem it seems was that integers changed from being returned as a bytes array to being an integer.

@kostko
Copy link
Member

kostko commented Jul 1, 2024

Not sure which fields you mean here, but it depends on how big the integers are. For 128-bit integers (e.g. u128) we use byte array encoding (as there is no native support), the same as quantities in the consensus layer. Others (e.g. u64) are encoded natively using compact encoding.

@CedarMist
Copy link
Member Author

CedarMist commented Jul 1, 2024

That'd be the 'epoch' and 'receipt' fields. of delegation & undelegation.

Either way, adding support for uint8, uint16, uint32 & uint64 when decoding has fixed this. If they haven't been changed, then no idea why I only just ran into this now.

Yup, it seems that my tests didn't try decoding the receipts returned from subcall for ReceiptUndelegateStart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Pull requests that update sapphire-contracts p:1 Priority: high s:underway Status: a patch is in progress solidity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants