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

Make value argument of /voucher entry-point optional #21

Open
guidanoli opened this issue Oct 25, 2024 · 6 comments
Open

Make value argument of /voucher entry-point optional #21

guidanoli opened this issue Oct 25, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@guidanoli
Copy link
Contributor

guidanoli commented Oct 25, 2024

Rationale

On SDK v1, vouchers had only two fields: destination and payload.
On-chain, this triggers a CALL instruction.
This instruction also takes a value as stack input, but we didn't specify it,
so Solidity would pass zero as the default value to message calls.

On SDK v2, we introduced the value field to parameterize this stack input.
In most cases, however, this field will still be zero.
It will only be non-zero when there is some movement of Ether.
The classic example is Ether withdrawals.

If this field were made obligatory in the HTTP API,
application back-ends would have to adapt every call to the /voucher entry-point,
just to pass the same value, zero.
To make this change backwards-compatible,
we believe that we can make this field optional,
with zero being a sensible default.

Proposal

Make the value argument of the /voucher entry-point optional.
The default value should be zero, just like before.
If this change is agreed upon, an equivalent issue should be opened on machine-emulator-tools.

@guidanoli guidanoli added the enhancement New feature or request label Oct 25, 2024
@tuler
Copy link
Member

tuler commented Oct 25, 2024

I support the change.
It’s basically removal of line

@jplgarcia
Copy link

Strong agree, but I would like to point that we also have to change the description of destination

description: 20-byte address of the destination contract for which the payload will be sent.

description: 20-byte address of the destination contract for which the payload will be sent.

Currently it specifiec it is the address of a contract and for ether withdrawals it can be the user who will be receiving the assets.
Correct @guidanoli ?

@guidanoli
Copy link
Contributor Author

Yes, destination can be any Ethereum account address.
If the account has some code, we say it's a smart contract.

@guidanoli
Copy link
Contributor Author

It’s basically removal of line

Yes, and we should make it clear that zero is the default value.

@miltonjonat
Copy link

Hi guys. Any reason why this didn't go forward?

@guidanoli
Copy link
Contributor Author

@vfusco

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

No branches or pull requests

4 participants