-
Notifications
You must be signed in to change notification settings - Fork 6k
Update EIP-7708: Move to Draft #9003
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
Changes from 3 commits
2d0af4a
1939890
68deb0c
700face
15abb8e
bb546d6
7b25326
f14d40a
370938e
4b19eb7
48758bc
5459529
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,24 +20,42 @@ Logs are often used to track when balance changes of assets on Ethereum. Logs wo | |
|
|
||
| ## Specification | ||
|
|
||
| ### Parameters | ||
| ### ETH transfer logs | ||
|
|
||
| * `MAGIC`: `TBD` | ||
| A log, identical to a LOG3, is issued for: | ||
|
|
||
| ### Functionality | ||
| - Any transaction (including zero-value-transferring), before any other logs created by EVM execution | ||
| - Any nonzero-value `CALL`, at the time that the value transfer executes | ||
| - Any nonzero-value-transferring `SELFDESTRUCT`, at the time that the value transfer executes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some edge cases to think about here:
For the sake of simplicity, I suggest we treat both cases as a transfer of value to self. There is not really a proper way to indicate that the balance is being burned in the case of 1.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible from solely the information in the logs (whatever is proposed to be emitted here), the transactions (amount, max prio fee), the receipts (gas used), the block header (base block fee, withdrawals), and the genesis balance (or, whatever the balance was at the time of the fork when this activates) to reconstruct the account balance accurately, in all cases? Or do we need a second log for burning ETH in these situations?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we would need a special log to indicate burn in the case of 1.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the case of 2. we can just mark this as a transfer of zero value to self. It's the only case where a value transfer log of this type would be allowed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The special log could either be a LOG2
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I like that
This could work.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Isn't burn for ETH a transfer to 0x0? (to null) like emission is a transfer from 0x0 Symbolic burns transfer to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a |
||
|
|
||
| Whenever (i) a nonzero-value `CALL`, (ii) a nonzero-value-transferring `SELFDESTRUCT`, or (iii) a nonzero-value-transferring transaction takes place, issue a log, identical to a LOG3, with three topics: (i) `MAGIC`, (ii) the sender address, (iii) the recipient address. The log data is a big-endian 32-byte encoding of the transfer value. | ||
| | Field | Value | | ||
| | - | - | | ||
| | `address` | `0xfffffffffffffffffffffffffffffffffffffffe` ([`SYSTEM_ADDRESS`](./eip-4788.md)) | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 0x000..000 better for Rlp encoding?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a byte array, not an int, so does not use varlen encoding. RLP encoding is There is also an idea of Right now it just uses the same system address from EIP-4788
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer 0x0 as is ETH the asset emitting the log; rather than the system But not strongly held
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, worth a broader discussion. Keep in mind can also change the value lateron if there are multiple opinions about it. For now, would just settle with any one so that implementations can continue.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, if I have this correctly, these are the rough meanings and benefits of each:
For now I'm going to implement @benaadams can I consider your opinion representative of Nethermind as a whole?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not "my choice", 0xfff..e was the only one depicting a concept of an address for "system originated" in the EIPs. If the tests use 0xeee..e, can also start with that one. Is confusing if EIP doesn't match the tests
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It was mentioned by @Carsons-Eels two comments above this that the specs and tests will use Can we agree before merging? From this thread, the agreement looks to be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah! That makes sense then :) Thanks!
etan-status marked this conversation as resolved.
Outdated
|
||
| | `topics[0]` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` (`keccak256('Transfer(address,address,uint256)')`) | | ||
| | `topics[1]` | `from` address (zero prefixed to fill uint256) | | ||
| | `topics[2]` | `to` address (zero prefixed to fill uint256) | | ||
| | `data` | `amount` in Wei (big endian uint256) | | ||
|
etan-status marked this conversation as resolved.
|
||
|
|
||
| The `LOG` of a value-transferring transaction should be placed before any logs created by EVM execution. The other two `LOG`s are placed at the time that the value transfer executes. | ||
| ### Fee payment logs | ||
|
|
||
| A log, identical to a LOG2, is issued for every transaction and appended after all other logs created by EVM execution. The fee amount incorporates the total fee charged during transaction execution, including the base fee, the priority fee, and potential blob fees. | ||
|
|
||
| | Field | Value | | ||
| | - | - | | ||
| | `address` | `0xfffffffffffffffffffffffffffffffffffffffe` ([`SYSTEM_ADDRESS`](./eip-4788.md)) | | ||
| | `topics[0]` | `0x7bd3aa7d673767f759ebf216e7f6c12844986c661ae6e0f1d988cf7eb7394d1d` (`keccak256('Fee(address,uint256)')`) | | ||
| | `topics[1]` | `from` address (zero prefixed to fill uint256) | | ||
| | `data` | `amount` in Wei (big endian uint256) | | ||
|
|
||
| ## Rationale | ||
|
|
||
| This is the simplest possible implementation that ensures that all ETH transfers are implemented in some kind of record that can be easily accessed through making RPC calls into a node, or through asking for a Merkle branch that is hashed into the block root. The log type is compatible with the ERC-20 token standard, but does not introduce any overly-specific ERC-20 features (eg. ABI encodings) into the specification. | ||
|
|
||
| ### Open questions | ||
|
|
||
| 1. Should withdrawals also trigger a log? If so, what should the sender address be specified as? | ||
| 2. Should fee payments trigger a log? It would ensure "completeness", in the sense that you can compute the exact current balance table by watching logs, but it would greatly increase the number of logs, perhaps to an unacceptably high amount. | ||
| 1. Magic value used for `address` and `topics[0]`? | ||
| 2. Should fee payments and priority fee credits trigger a log? It would ensure "completeness", in the sense that you can compute the exact current balance table by watching logs, but it would greatly increase the number of logs, perhaps to an unacceptably high amount. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fee credit could be made manageable with https://eips.ethereum.org/EIPS/eip-8115
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the fee deduction could be made manageable with https://eips.ethereum.org/EIPS/eip-7668 |
||
| 3. Should withdrawals also trigger a log? They are not associated with transactions. | ||
|
|
||
| ## Backwards Compatibility | ||
|
|
||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.