Skip to content
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

feat(txpool): disable blob tx #277

Closed
wants to merge 13 commits into from
5 changes: 3 additions & 2 deletions cmd/evm/t8n_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,15 @@ func TestT8n(t *testing.T) {
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
{ // Cancun tests
// CHANGE(TAIKO): disable cancun test case.
/*{ // Cancun tests
base: "./testdata/28",
input: t8nInput{
"alloc.json", "txs.rlp", "env.json", "Cancun", "",
},
output: t8nOutput{alloc: true, result: true},
expOut: "exp.json",
},
},*/
{ // More cancun tests
base: "./testdata/29",
input: t8nInput{
Expand Down
5 changes: 3 additions & 2 deletions core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,15 @@ func opBlobBaseFee(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
}

// enable4844 applies EIP-4844 (BLOBHASH opcode)
func enable4844(jt *JumpTable) {
// CHANGE(TAIKO): disable enable4844
/*func enable4844(jt *JumpTable) {
jt[BLOBHASH] = &operation{
execute: opBlobHash,
constantGas: GasFastestStep,
minStack: minStack(1, 1),
maxStack: maxStack(1, 1),
}
}
}*/

// enable7516 applies EIP-7516 (BLOBBASEFEE opcode)
func enable7516(jt *JumpTable) {
Expand Down
3 changes: 2 additions & 1 deletion core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func validate(jt JumpTable) JumpTable {

func newCancunInstructionSet() JumpTable {
instructionSet := newShanghaiInstructionSet()
enable4844(&instructionSet) // EIP-4844 (BLOBHASH opcode)
// CHANGE(TAIKO): disable 4844
//enable4844(&instructionSet) // EIP-4844 (BLOBHASH opcode)
enable7516(&instructionSet) // EIP-7516 (BLOBBASEFEE opcode)
enable1153(&instructionSet) // EIP-1153 "Transient Storage"
enable5656(&instructionSet) // EIP-5656 (MCOPY opcode)
Expand Down
7 changes: 4 additions & 3 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state/pruner"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/txpool/blobpool"
"github.com/ethereum/go-ethereum/core/txpool/legacypool"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
Expand Down Expand Up @@ -222,14 +221,16 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.BlobPool.Datadir != "" {
config.BlobPool.Datadir = stack.ResolvePath(config.BlobPool.Datadir)
}
blobPool := blobpool.New(config.BlobPool, eth.blockchain)
// CHANGE(TAIKO): disable blob pool
//blobPool := blobpool.New(config.BlobPool, eth.blockchain)

if config.TxPool.Journal != "" {
config.TxPool.Journal = stack.ResolvePath(config.TxPool.Journal)
}
legacyPool := legacypool.New(config.TxPool, eth.blockchain)

eth.txPool, err = txpool.New(config.TxPool.PriceLimit, eth.blockchain, []txpool.SubPool{legacyPool, blobPool})
// CHANGE(TAIKO): disable blob pool
eth.txPool, err = txpool.New(config.TxPool.PriceLimit, eth.blockchain, []txpool.SubPool{legacyPool})
if err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,8 @@ func TestCall(t *testing.T) {
expectErr: core.ErrBlobTxCreate,
},
// BLOBHASH opcode
{
// CHANGE(TAIKO): disable cancun test case.
/*{
blockNumber: rpc.LatestBlockNumber,
call: TransactionArgs{
From: &accounts[1].addr,
Expand All @@ -949,7 +950,7 @@ func TestCall(t *testing.T) {
},
},
want: "0x0122000000000000000000000000000000000000000000000000000000000000",
},
},*/
}
for i, tc := range testSuite {
result, err := api.Call(context.Background(), tc.call, &rpc.BlockNumberOrHash{BlockNumber: &tc.blockNumber}, &tc.overrides, &tc.blockOverrides)
Expand Down
4 changes: 4 additions & 0 deletions tests/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ func (tm *testMatcher) walk(t *testing.T, dir string, runTest interface{}) {
}
err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
name := filepath.ToSlash(strings.TrimPrefix(path, dir+string(filepath.Separator)))
// CHANGE(TAIKO): ignore cancun test cases.
if strings.HasPrefix(name, "cancun") {
return nil
}
if info.IsDir() {
if _, skipload := tm.findSkip(name + "/"); skipload {
return filepath.SkipDir
Expand Down
Loading