Skip to content

Commit

Permalink
Update CIP-137 & CIP-1559 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenxingLi authored May 17, 2024
1 parent 5f9343b commit c495236
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CIPs/cip-137.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If CIP-1559 has not yet been activated, CIP-137 does not change any behavior; if

During transaction execution, if a transaction's `max_gas_price` is less than the `burnt_gas_price`, the transaction execution fails without bumping nonce. Otherwise, the transaction's `actual_base_gas_price` is defined as the minimum of the `base_gas_price` and `tx.max_gas_price`. After determining the `actual_base_gas_price`, the same rules as in EIP-1559 are used to calculate the `priority_gas_price`, and the transaction's `actual_gas_price` is `actual_base_gas_price + priority_gas_price`. The miner's reward is calculated by `actual_gas_price-burnt_gas_price`.The logic for checking and collecting transaction fees, as well as the logic for contract sponsorship, is based on the calculated `actual_gas_price`.

Exception: If an account balance is insufficient to pay the transaction fee, all transaction fees are burnt and not distributed to miners.
Exception: If an account balance is insufficient to pay the transaction fee, the actual transaction fee may be less than `burnt_gas_price * tx.gas_limit`. In this case, all the transaction fees are burnt.

## Rationale
N/A
Expand Down
25 changes: 23 additions & 2 deletions CIPs/cip-1559.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ During transaction execution, the entire epoch's base gas price will be determin

### Special Handling for Espace Blocks

Since espace transactions can only be packaged at heights that are multiples of 5, the `base_gas_price` for espace must remain unchanged at other heights.
Since espace transactions can only be packaged at heights that are multiples of 5, the `base_gas_price_in_espace` for espace must remain unchanged at other heights.

### Modifications to Receipts

Expand All @@ -76,4 +76,25 @@ If the gas limit of core space blocks fluctuates based on whether espace transac

### Why Adjust Gas Using the Current Block's Gas Limit

Due to the presence of a deferred execution mechanism, it is impossible to adjust the base gas price using the gas used; therefore, the gas limit is used instead. Using the gas limit from the previous block would require accessing transaction blocks from five heights prior for espace blocks, which would increase the overhead in the consensus process.
Due to the presence of a deferred execution mechanism, it is impossible to adjust the base gas price using the gas used; therefore, the gas limit is used instead. Using the gas limit from the previous block would require accessing transaction blocks from five heights prior for espace blocks, which would increase the overhead in the consensus process.

## Rationale
N/A

## Backwards Compatibility
This CIP is Spec Breaking.

## Test Cases
<!--Test cases for an implementation are mandatory for CIPs that are affecting consensus changes. Other CIPs can choose to include links to test cases if applicable.-->
N/A

## Implementation
<!--The implementations must be completed before any CIP is given status "Final", but it need not be completed before the CIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details.-->
N/A

## Security Considerations
<!--All CIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. CIP submissions missing the "Security Considerations" section will be rejected. a CIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.-->
N/A

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 comments on commit c495236

Please sign in to comment.