MetaMask / MetaMask/metamask-extension

[Bug]: Unable to configure hardfork/ EIPS

Open
#31,932 2 comments 2 reactions 0 assignees View on GitHub
external-contributor regression-prod-12.15.2 Sev2-normal team-core-platform type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### Describe the bug

Hey there 👋

We are hitting an issue with the latest release
It looks like the latest version is using `@metamsk/transaction-controller` `50.0.0`

This version define the default hardfork to be [Prague](https://github.com/MetaMask/core/blob/3350d56f237d0fc5ae2f3d7663c779fd7b025281/packages/transaction-controller/src/utils/prepare.ts?plain=1#L10)
and there are no way to configure how the chain `Common` from `@ethereumjs/common` is configured

This is how the `Common::custom` is being called:

https://github.com/MetaMask/core/blob/3350d56f237d0fc5ae2f3d7663c779fd7b025281/packages/transaction-controller/src/utils/prepare.ts?plain=1#L48

```ts
function getCommonConfiguration(chainId: Hex): Common {
const customChainParams: Partial = {
chainId: parseInt(chainId, 16),
defaultHardfork: HARDFORK,
};

return Common.custom(customChainParams, {
eips: [7702],
});
}
```

As a result this break our chain for certain transaction types
For example this Hardfork integrate EIP-3860 that defines a `maxInitCodeSize` that is too low for our chain

### Expected behavior

There should be an option to configure the chain and define what fork / EIP it support

### Screenshots/Recordings

_No response_

### Steps to reproduce

1. Go to https://remix.polkadot.io/ (our Remix fork for Polkadot)
2. Build https://wizard.openzeppelin.com/#erc20
3. Deploy

### Error messages or log output

```shell
Notice that the contract fails to deploy with

creation of MyToken errored: Error occurred: the initcode size of this transaction is too large: it is 82059 while the max is 49152.
```

### Detection stage

In production (default)

### Version

12.15.2

### Build type

None

### Browser

Chrome

### Operating system

MacOS

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with packages/transaction-controller/src/utils/prepare.ts, especially getCommonConfiguration and its Common.custom call, then reproduce the deployment failure through the linked Remix flow. Trace how the hardfork and EIP configuration reaches transaction preparation; done means the chain can configure supported forks or EIPs without applying an incompatible initcode limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.