Skip to content

Add EIP: BURN opcode #8914

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

Merged
merged 17 commits into from
Oct 21, 2024
Merged

Add EIP: BURN opcode #8914

merged 17 commits into from
Oct 21, 2024

Conversation

itsdevbear
Copy link
Contributor

ATTENTION: ERC-RELATED PULL REQUESTS NOW OCCUR IN ETHEREUM/ERCS

--

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@itsdevbear itsdevbear requested a review from eth-bot as a code owner September 30, 2024 16:01
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Sep 30, 2024
@itsdevbear itsdevbear changed the title New opcode BURN Add New opcode BURN Draft Sep 30, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented Sep 30, 2024

✅ All reviewers have approved.

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Sep 30, 2024
@eth-bot eth-bot changed the title Add New opcode BURN Draft Add EIP: New opcode BURN Sep 30, 2024
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Sep 30, 2024
@itsdevbear itsdevbear changed the title Add EIP: New opcode BURN Add EIP: New opcode BURN Sep 30, 2024
@eth-bot eth-bot changed the title Add EIP: New opcode BURN Add EIP: New opcode BURN Oct 1, 2024
Copy link

github-actions bot commented Oct 1, 2024

The commit 0357fed (as a parent of 3b67b29) contains errors.
Please inspect the Run Summary for details.

@itsdevbear itsdevbear changed the title Add EIP: New opcode BURN Add EIP-7775: New opcode BURN Oct 7, 2024
@eth-bot eth-bot changed the title Add EIP-7775: New opcode BURN Add EIP: New opcode BURN Oct 7, 2024
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Oct 7, 2024
@eth-bot eth-bot changed the title Add EIP: New opcode BURN Add EIP: BURN opcode Oct 7, 2024
@itsdevbear itsdevbear changed the title Add EIP: BURN opcode Add EIP-7775: BURN opcode Oct 7, 2024
@eth-bot eth-bot changed the title Add EIP-7775: BURN opcode Add EIP: BURN opcode Oct 7, 2024

The base gas cost for the `BURN` opcode is 100 gas. The dynamic gas cost is determined as follows:

1. If the value to be burned is 0, the dynamic gas cost is 0.
Copy link
Member

Choose a reason for hiding this comment

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

0 is also too low, also for a no-op. A no-op JUMPDEST costs 1 gas. Also note we have to pop one item from stack here. 3 would be reasonable here (same as the EQ operator, which pops two items and compares those)

Copy link
Contributor Author

@itsdevbear itsdevbear Oct 16, 2024

Choose a reason for hiding this comment

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

This is just the dynamic cost. The min cost of the opcode is always 100, should I add another 3 gas on this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jochem-brouwer thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

The base cost is too low, see: #8914 (comment)

Copy link
Member

@jochem-brouwer jochem-brouwer Oct 19, 2024

Choose a reason for hiding this comment

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

Or wait, maybe dynamic should be made higher if the target is cold. The cost is too low for cold accounts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jochem-brouwer I think the dyn can be 0 if account is cold, since we can short circuit on balance. Updated to reflect. LMK what u think.

@eth-bot eth-bot enabled auto-merge (squash) October 21, 2024 03:51
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 f4baea0 into ethereum:master Oct 21, 2024
12 checks passed
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.

6 participants