Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat: london #1135

Merged
merged 83 commits into from
Sep 17, 2021
Merged

feat: london #1135

merged 83 commits into from
Sep 17, 2021

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented Sep 7, 2021

  • Addition of EIP-1559 transactions.
  • Added baseFeePerGas to a block
  • When London is activated, use baseFeePerGas as the block's gasPrice
  • When London is activated, re-prioritize the txPool based off of the transaction's new effectiveGasPrice
  • Write tests for miner and txPool reordering
  • Fix some instamine behavior
    • Added a DESIGN-DECISIONS.md to explain the change
  • Set london as the default hard fork
  • Fixed bug in how typed transactions are signed (no longer including the tx type)

@davidmurdoch davidmurdoch changed the base branch from feat/eip-1559-tx to develop September 7, 2021 23:21
src/chains/ethereum/block/src/runtime-block.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/api.ts Show resolved Hide resolved
src/chains/ethereum/ethereum/src/api.ts Show resolved Hide resolved
src/chains/ethereum/ethereum/src/blockchain.ts Outdated Show resolved Hide resolved
accessList?: never;
maxPriorityFeePerGas?: never;
maxFeePerGas?: never;
export type LegacyRpcTransaction = Readonly<RpcTransaction> & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious about the reasoning for this!

Copy link
Member Author

Choose a reason for hiding this comment

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

We should never mutate the json data a user gives us (like in provider.send("eth_sendTransaction", transaction)) but in one place in our code we were. Marking the type as Readonly prevents that sort of bug from happening.

src/chains/ethereum/block/src/block.ts Outdated Show resolved Hide resolved
src/chains/ethereum/block/src/block.ts Outdated Show resolved Hide resolved
@@ -64,12 +64,11 @@ export class Block {
});
}

toJSON(includeFullTransactions = false) {
toJSON(includeFullTransactions = false, common: Common) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Probably fine to leave it as is and fix when we re-organize the transactions classes

src/packages/utils/src/utils/heap.ts Show resolved Hide resolved
@@ -83,7 +106,7 @@ export class EIP1559FeeMarketTransaction extends RuntimeTransaction {
this.updateEffectiveGasPrice();
}

public toJSON(): EIP1559FeeMarketTransactionJSON {
public toJSON(_common?: Common): EIP1559FeeMarketTransactionJSON {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think the _common is needed because the super class needs it because LegacyTransaction needs it. The _ makes the linter stop complaining about an unused variable.

accessList?: never;
maxPriorityFeePerGas?: never;
maxFeePerGas?: never;
export type LegacyRpcTransaction = Readonly<RpcTransaction> & {
Copy link
Member Author

Choose a reason for hiding this comment

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

We should never mutate the json data a user gives us (like in provider.send("eth_sendTransaction", transaction)) but in one place in our code we were. Marking the type as Readonly prevents that sort of bug from happening.

@MicaiahReid MicaiahReid merged commit ded8b37 into develop Sep 17, 2021
@MicaiahReid MicaiahReid deleted the feat/eip-1559-tx-david-temp branch September 17, 2021 19:13
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.

Support london hardfork
2 participants