Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Set the minimal gas of a Polyjuice transaction #159

Closed
wants to merge 4 commits into from

Conversation

magicalne
Copy link
Contributor

@magicalne magicalne commented Jun 6, 2022

Ethereum charges a 21000 gas fee for standard transfer transactions to cover the cost from (1. signature recover (2. tx data storage (3. two account balance write. https://github.com/ethereum/go-ethereum/blob/b3b8b268eb585dfd3c1c9e9bbebc55968f3bec4b/params/protocol_params.go#L32

This PR:

  • check the gas limit and return an error if the gas limit is less than 21000.
  • If the gas used is less than 21000, set it to 21000 instead.
  • make sure gas_used not exceed msg.gas

Related issue

@Flouse Flouse requested review from TheWaWaR, jjyr and Flouse June 6, 2022 07:47
@Flouse Flouse changed the title Set min gas of polyjuice tx. Set the mininal gas of a Polyjuice transaction Jun 6, 2022
@Flouse
Copy link
Collaborator

Flouse commented Jun 6, 2022

Please fix the tests.

@Flouse Flouse changed the title Set the mininal gas of a Polyjuice transaction Set the minimal gas of a Polyjuice transaction Jun 6, 2022
@Flouse Flouse requested a review from RetricSu June 6, 2022 15:29
@Flouse
Copy link
Collaborator

Flouse commented Jun 7, 2022

@Flouse Flouse closed this Jun 7, 2022
@magicalne magicalne deleted the min_gas branch September 23, 2022 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants