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

Update EIP-7002: return fee from getter and add usage example #9024

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Nov 7, 2024

The get operation is meant to be used by contracts to compute the exact amount of ether required to add a withdrawal request. It does not return the fee directly though, but it returns the count of 'excess requests' instead. The caller has to compute the fee themselves by applying the fee formula.

I think this is not great. The fee logic, while reasonably straightforward, is an implementation detail of the contract. Duplicating it into caller contracts could lead to a mismatch in the computed values, and it's not necessary. I propose we change the system contract to return the fee directly. This contract change has also been submitted in this PR: lightclient/sys-asm#33

The Rationale section of the EIP also had some outdated text about returning fee overage to the caller. The contract does not return overage, so I am removing that section here, and adding recommendations & example code for calling the contract.

Related change to EIP-7251: #9025

@fjl fjl requested a review from eth-bot as a code owner November 7, 2024 13:31
@github-actions github-actions bot added c-update Modifies an existing proposal s-review This EIP is in Review t-core labels Nov 7, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented Nov 7, 2024

File EIPS/eip-7002.md

Requires 1 more reviewers from @adietrichs, @djrtwo, @hwwhww, @lightclient, @mkalinin

@eth-bot eth-bot added the a-review Waiting on author to review label Nov 7, 2024
@eth-bot eth-bot changed the title EIP-7002: return fee from getter and add usage example Update EIP-7002: return fee from getter and add usage example Nov 7, 2024
The get operation is meant to be used by contracts to compute the exact amount of ether
required to add a withdrawal request. It does not return the fee directly though, but it
returns the count of 'excess requests' instead. The caller has to compute the fee
themselves by applying the fee formula.

I think this is not great. The fee logic, while reasonably straightforward, is an
implementation detail of the contract. Duplicating it into caller contracts could lead to
a mismatch in the computed values, and it's not necessary. I propose we change the
system contract to return the fee directly. This contract change has also been submitted
in this PR: lightclient/sys-asm#33

The Rationale section of the EIP also had some outdated text about returning fee overage
to the caller. The contract does not return overage, so I am removing that section here,
and adding recommendations & example code for calling the contract.
@pk910
Copy link
Member

pk910 commented Nov 9, 2024

The number of requests in the queue is very helpful to calculate when a request gets dequeued and processed by the consensus layer..
I get the Idea of not duplicating the fee logic, and appreciate that. But the number of entries should still be available somehow, as going back from the fee to that number is impossible.

@fjl
Copy link
Contributor Author

fjl commented Nov 14, 2024

Thanks for bringing this up. My question is, do you really need to access the number of excess entries from within a contract?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-review Waiting on author to review c-update Modifies an existing proposal s-review This EIP is in Review t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants