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

Add EIP: ETH transfers emit a log #8575

Merged
merged 7 commits into from
Jun 11, 2024
Merged

Add EIP: ETH transfers emit a log #8575

merged 7 commits into from
Jun 11, 2024

Conversation

vbuterin
Copy link
Contributor

All ETH-transferring calls emit a log.

All ETH-transferring calls emit a log.
@vbuterin vbuterin requested a review from eth-bot as a code owner May 17, 2024 12:10
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels May 17, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented May 17, 2024

✅ All reviewers have approved.

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels May 17, 2024
@eth-bot eth-bot changed the title New EIP: ETH-transferring calls emit a log Add EIP: ETH-transferring calls emit a log May 17, 2024
@github-actions github-actions bot added the w-ci Waiting on CI to pass label May 17, 2024
Copy link

The commit 136f035 (as a parent of 3668b6f) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot removed the w-ci Waiting on CI to pass label May 17, 2024
@eth-bot eth-bot changed the title Add EIP: ETH-transferring calls emit a log Add EIP: ETH transfers emit a log May 17, 2024
EIPS/eip-9999.md Outdated Show resolved Hide resolved
EIPS/eip-9999.md Outdated
title: ETH transfers emit a log
description: All ETH transfers emit a log
author: Vitalik Buterin (@vbuterin), Peter Davies (@petertdavies)
discussions-to: https://ethereum-magicians.org/t/eip-all-value-transferring-calls-create-a-log/20034
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
discussions-to: https://ethereum-magicians.org/t/eip-all-value-transferring-calls-create-a-log/20034
discussions-to: https://ethereum-magicians.org/t/eip-7708-eth-transfers-emit-a-log/20034

Copy link

@Selarun15 Selarun15 Jun 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0xa170ecfc733473C7c757185fEb279Bf282D83CDa

Copy link

@Hawthorne001 Hawthorne001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests

@finewhitechic
Copy link

All ETH-transferring calls emit a log.

I want to make a transfer with my tokens. To borrow usd. I'm not sure what to do or how to go by doing it???

@Hawthorne001
Copy link

import azure.functions as func
from elasticsearch import Elasticsearch

Client initialization

client = Elasticsearch(
cloud_id="deployment-name:ABCD...",
api_key=...
)

def main(request: func.HttpRequest) -> func.HttpResponse:
# Use the client
client.search(index=..., query={"match_all": {}})

from elasticsearch import Elasticsearch

Client initialization

client = Elasticsearch(
cloud_id="deployment-name:ABCD...",
api_key=...
)

def main(request):
# Use the client
client.search(index=..., query={"match_all": {}})

C:\Projects\Code\WanPathFileShareSystem-v2-QA\MyWorkDrive.Solutions.Client\WanPath.WopiAuth.Account.LoginWopi.btnStep2_Click(Object sender, EventArgs e) in C:\Projects\Code\WanPathFileShareSystem-v2-QA\MyWorkDrive.Solutions.Client\WanPath.WopiAuth\Account\LoginWopi.aline 1:4
---> 1 C:\Projects\Code\WanPathFileShareSystem-v2-QA\MyWorkDrive.Solutions.Client\WanPath.WopiAuth\Account\LoginWopi.aspx.cs

   2 WanPath.WopiAuth.Account.LoginWopi.btnStep2_Click(Object sender, EventArgs e) in C:\Projects\Code\WanPathFileShareSystem-v2-QA\MyWorkDrive.Solutions.Client\WanPath.line 

vbuterin and others added 2 commits May 20, 2024 14:34
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
EIPS/eip-7708.md Outdated Show resolved Hide resolved
@holic
Copy link

holic commented May 30, 2024

my kingdom for a log on CREATE as well

@cstoneham
Copy link

There's nothing I desire more than this.

@karalabe
Copy link
Member

karalabe commented May 31, 2024

Would emitting these new logs be free or incur the default log emit costs? Asking because if it costs something, then gas accounting can get a bit funky in certain places (e.g. if I want to emit a log with the total fees paid, which depend on emitting the log itself, before emitting the log itself :P)

@charlieflipside
Copy link

charlieflipside commented May 31, 2024

All ETH-transferring calls emit a log.

Would emphasize non-traditional transfers need (possibly duplicative) logs as well to ensure the UX assumptions of transfers holds. Adding ETH transfer logs without these special cases handled will result in ethereum data providers to be inundated with faulty assumptions from their users (most specifically, net transfers != ETH balance at a block height)

ETH Gas payments should also emit event that corresponds with a transfer to 0x0000...0000
emit gas_paid(user, amt)
emit transfer(from user, to 0x0000...0000)

ETH beacon chain rewards should emit
emit beacon_mint (receiver, amt)
emit transfer(from 0x000...0000, to user)

contract self destructs should emit 2 transfers
emit self_destruct (contract, to, amt)
emit transfer(from contract, to 0x000...0000)
emit transfer(from 0x000....0000, to receiver)

Data providers currently use traces to identify ETH transfers, so logs would be a small quality of life improvement if done well, but could actually cause more headaches if special cases (like self destruct bypassing contract payable() status) are not handled.

@karalabe
I think they'd have to be free, generated as a byproduct of the state change; see above gas_paid() log note. EIP-1559 becomes relevant as well to differentiate burn %.

@fergmolina
Copy link

agree with @charlieflipside . it should include fees payments and block rewards. My only concern here is that this change is going to almost duplicate the amount of logs per day: Dune Dashboard - EIP-7708

@PHOENIXENT
Copy link

wwdc2023-10042 2.txt

Copy link

@Hawthorne001 Hawthorne001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EIPS/eip-9999.md Outdated
title: ETH transfers emit a log
description: All ETH transfers emit a log
author: Vitalik Buterin (@vbuterin), Peter Davies (@petertdavies)
discussions-to: https://ethereum-magicians.org/t/eip-all-value-transferring-calls-create-a-log/20034
Copy link

@Selarun15 Selarun15 Jun 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for draft, some Todos and open questions that would need to be addressed before review

@eth-bot eth-bot enabled auto-merge (squash) June 11, 2024 14:06
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit f25c6c8 into master Jun 11, 2024
13 checks passed
@eth-bot eth-bot deleted the vbuterin-patch-2 branch June 11, 2024 14:06
Copy link

@Nichebiche Nichebiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nichebiche

Copy link

@Nichebiche Nichebiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nichebiche

@KillariDev
Copy link
Contributor

KillariDev commented Jun 14, 2024

Ethereum transfers generating logs is super useful! In eth_simulateV1 (ethereum/execution-apis#484) we decided to add a flag traceTransfers to enable ETH logs. This flag will trace Ethereum transfers and return them as ERC20 transfer logs:

"logs": [
	{
		"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
		"topics": [
			"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
			"0x000000000000000000000000c000000000000000000000000000000000000000",
			"0x000000000000000000000000c100000000000000000000000000000000000000"
		],
		"data": "0x00000000000000000000000000000000000000000000000000000000000003e8",
		"blockNumber": "0x4",
		"transactionHash": "0xa4d41019e71335f8567e17746b708ddda8b975a9a61f909bd3df55f4866cc913",
		"transactionIndex": "0x0",
		"blockHash": "0x859c932c5cf0dabf8d12eb2518e063966ac1a25e2fc49f1f02574a37f358d0b5",
		"logIndex": "0x0",
		"removed": false
	}
],

You can see the log coming from address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, these are eth transfer logs.

These logs are emitted when you simulate a transaction with eth_simulateV1. These logs don't contribute to the gas cost, and they are not included in logs bloom in eth_simulateV1. This is of course only a simulation (like eth_call), these logs are not stored anywhere after the call has finished.

Copy link

@Nichebiche Nichebiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome niche

@PHOENIXENT
Copy link

9x9876543210.0123456789!

@Nichebiche
Copy link

9x9876543210.0123456789!

@HoangTranMap
Copy link

HoangTranMap commented Jun 28, 2024 via email

Scamreno referenced this pull request Jun 29, 2024
* Fix EIP-Bot CI

* Add newline to CODEOWNERS

* Make changes for testing

* Test if GH Actions is a valid codeowner

* It isn't allowed

* Fix infinite loop

* Do some tricks to avoid unneccesary extra runs

* Fixing bug

* Add Pandapip1-bot

* Fix quotes

* Another fix bites the dust

* Another fix

* Another thing

* Use my testing fork

* More fixes

* Unpin while in dev

* Add testing bot to codeowners

* Is that the bug?

* Try this fix

* Quickfix

* That was an easy fix

* Remove Pandapip1-bot references

* Update diff

* Missed some

* Pin to commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.