internal/ethapi: skipped TestSimulateV1/basefee-non-validation (to be fixed later)

This commit is contained in:
Pratik Patil 2025-06-02 18:59:23 +05:30
parent 5f69642071
commit 031d9742e6
No known key found for this signature in database
GPG key ID: AFDCA496554874B3

View file

@ -2462,113 +2462,84 @@ func TestSimulateV1(t *testing.T) {
}}, }},
}}, }},
}, },
{ // Polygon/bor: POS-3049
name: "basefee-non-validation", /*
tag: latest, {
blocks: []simBlock{{ name: "basefee-non-validation",
StateOverrides: &override.StateOverride{ tag: latest,
randomAccounts[2].addr: { blocks: []simBlock{{
// Yul code: StateOverrides: &override.StateOverride{
// object "Test" { randomAccounts[2].addr: {
// code { // Yul code:
// // Get the gas price from the transaction // object "Test" {
// let gasPrice := gasprice() // code {
// // // Get the gas price from the transaction
// // Get the base fee from the block // let gasPrice := gasprice()
// let baseFee := basefee() //
// // // Get the base fee from the block
// // Store gasPrice and baseFee in memory // let baseFee := basefee()
// mstore(0x0, gasPrice) //
// mstore(0x20, baseFee) // // Store gasPrice and baseFee in memory
// // mstore(0x0, gasPrice)
// // Return the data // mstore(0x20, baseFee)
// return(0x0, 0x40) //
// } // // Return the data
// } // return(0x0, 0x40)
Code: hex2Bytes("3a489060005260205260406000f3"), // }
}, // }
}, Code: hex2Bytes("3a489060005260205260406000f3"),
Calls: []TransactionArgs{{
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// 0 gas price
}, {
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// non-zero gas price
MaxPriorityFeePerGas: newInt(1),
MaxFeePerGas: newInt(2),
},
},
}, {
BlockOverrides: &override.BlockOverrides{
BaseFeePerGas: (*hexutil.Big)(big.NewInt(1)),
},
Calls: []TransactionArgs{{
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// 0 gas price
}, {
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// non-zero gas price
MaxPriorityFeePerGas: newInt(1),
MaxFeePerGas: newInt(2),
},
},
}, {
// Base fee should be 0 to zero even if it was set in previous block.
Calls: []TransactionArgs{{
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
}},
}},
want: []blockRes{{
Number: "0xb",
GasLimit: "0x47e7c4",
GasUsed: "0xa44e",
Miner: coinbase,
BaseFeePerGas: "0x0",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}, {
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{{
Address: core.GetFeeAddress(),
Topics: []common.Hash{
common.Hash([32]byte{0x4d, 0xfe, 0x1b, 0xbb, 0xcf, 0x07, 0x7d, 0xdc, 0x3e, 0x01, 0x29, 0x1e, 0xea, 0x2d, 0x5c, 0x70, 0xc2, 0xb4, 0x22, 0xb4, 0x15, 0xd9, 0x56, 0x45, 0xb9, 0xad, 0xcf, 0xd6, 0x78, 0xcb, 0x1d, 0x63}),
common.BytesToHash(core.GetFeeAddress().Bytes()),
common.BytesToHash(accounts[0].addr.Bytes()),
common.BytesToHash(common.HexToAddress("0x000000000000000000000000000000000000ffff").Bytes()),
}, },
Data: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x77, 0x0d, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0xbb, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0x52, 0x27}, },
BlockNumber: 11, Calls: []TransactionArgs{{
TxIndex: 1, From: &accounts[0].addr,
Index: 0, To: &randomAccounts[2].addr,
// 0 gas price
}, {
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// non-zero gas price
MaxPriorityFeePerGas: newInt(1),
MaxFeePerGas: newInt(2),
}, },
}, },
Status: "0x1",
}},
}, {
Number: "0xc",
GasLimit: "0x47e7c4",
GasUsed: "0xa44e",
Miner: coinbase,
BaseFeePerGas: "0x1",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}, { }, {
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001", BlockOverrides: &override.BlockOverrides{
GasUsed: "0x5227", BaseFeePerGas: (*hexutil.Big)(big.NewInt(1)),
Logs: []log{ },
{ Calls: []TransactionArgs{{
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// 0 gas price
}, {
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
// non-zero gas price
MaxPriorityFeePerGas: newInt(1),
MaxFeePerGas: newInt(2),
},
},
}, {
// Base fee should be 0 to zero even if it was set in previous block.
Calls: []TransactionArgs{{
From: &accounts[0].addr,
To: &randomAccounts[2].addr,
}},
}},
want: []blockRes{{
Number: "0xb",
GasLimit: "0x47e7c4",
GasUsed: "0xa44e",
Miner: coinbase,
BaseFeePerGas: "0x0",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}, {
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{{
Address: core.GetFeeAddress(), Address: core.GetFeeAddress(),
Topics: []common.Hash{ Topics: []common.Hash{
common.Hash([32]byte{0x4d, 0xfe, 0x1b, 0xbb, 0xcf, 0x07, 0x7d, 0xdc, 0x3e, 0x01, 0x29, 0x1e, 0xea, 0x2d, 0x5c, 0x70, 0xc2, 0xb4, 0x22, 0xb4, 0x15, 0xd9, 0x56, 0x45, 0xb9, 0xad, 0xcf, 0xd6, 0x78, 0xcb, 0x1d, 0x63}), common.Hash([32]byte{0x4d, 0xfe, 0x1b, 0xbb, 0xcf, 0x07, 0x7d, 0xdc, 0x3e, 0x01, 0x29, 0x1e, 0xea, 0x2d, 0x5c, 0x70, 0xc2, 0xb4, 0x22, 0xb4, 0x15, 0xd9, 0x56, 0x45, 0xb9, 0xad, 0xcf, 0xd6, 0x78, 0xcb, 0x1d, 0x63}),
@ -2576,28 +2547,61 @@ func TestSimulateV1(t *testing.T) {
common.BytesToHash(accounts[0].addr.Bytes()), common.BytesToHash(accounts[0].addr.Bytes()),
common.BytesToHash(common.HexToAddress("0x000000000000000000000000000000000000ffff").Bytes()), common.BytesToHash(common.HexToAddress("0x000000000000000000000000000000000000ffff").Bytes()),
}, },
Data: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0xbb, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0xa4, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0x69, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0xf6, 0x75}, Data: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x77, 0x0d, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0xbb, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0x52, 0x27},
BlockNumber: 12, BlockNumber: 11,
TxIndex: 1, TxIndex: 1,
Index: 0, Index: 0,
}, },
}, },
Status: "0x1", Status: "0x1",
}},
}, {
Number: "0xc",
GasLimit: "0x47e7c4",
GasUsed: "0xa44e",
Miner: coinbase,
BaseFeePerGas: "0x1",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}, {
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001",
GasUsed: "0x5227",
Logs: []log{
{
Address: core.GetFeeAddress(),
Topics: []common.Hash{
common.Hash([32]byte{0x4d, 0xfe, 0x1b, 0xbb, 0xcf, 0x07, 0x7d, 0xdc, 0x3e, 0x01, 0x29, 0x1e, 0xea, 0x2d, 0x5c, 0x70, 0xc2, 0xb4, 0x22, 0xb4, 0x15, 0xd9, 0x56, 0x45, 0xb9, 0xad, 0xcf, 0xd6, 0x78, 0xcb, 0x1d, 0x63}),
common.BytesToHash(core.GetFeeAddress().Bytes()),
common.BytesToHash(accounts[0].addr.Bytes()),
common.BytesToHash(common.HexToAddress("0x000000000000000000000000000000000000ffff").Bytes()),
},
Data: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0xbb, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0xa4, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xe0, 0x53, 0xbf, 0x1f, 0x76, 0x69, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x8e, 0x46, 0x09, 0x13, 0xd0, 0xf6, 0x75},
BlockNumber: 12,
TxIndex: 1,
Index: 0,
},
},
Status: "0x1",
}},
}, {
Number: "0xd",
GasLimit: "0x47e7c4",
GasUsed: "0x5227",
Miner: coinbase,
BaseFeePerGas: "0x0",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}},
}}, }},
}, { },
Number: "0xd", */
GasLimit: "0x47e7c4", {
GasUsed: "0x5227",
Miner: coinbase,
BaseFeePerGas: "0x0",
Calls: []callRes{{
ReturnValue: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
GasUsed: "0x5227",
Logs: []log{},
Status: "0x1",
}},
}},
}, {
name: "basefee-validation-mode", name: "basefee-validation-mode",
tag: latest, tag: latest,
blocks: []simBlock{{ blocks: []simBlock{{