Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
75a3aff
feat: implement temporary authorized account priority transaction ord…
hominlee-wemade Nov 11, 2025
639276f
test: add test cases for authorized account transaction ordering
hominlee-wemade Nov 11, 2025
303fb23
chore: remove comment
hominlee-wemade Nov 11, 2025
119fd63
feat: update msg.GasTipCap handling in TransactionToMessage for autho…
hominlee-wemade Nov 12, 2025
3dfdecb
feat: pass stateDB as input parameter to TransactionToMessag
hominlee-wemade Nov 12, 2025
01d8f8b
feat: move effectiveGasPrice calculation for authorized accounts to a…
hominlee-wemade Nov 12, 2025
f7c89d6
test: add gas fee calculation tests for authorized and normal accounts
hominlee-wemade Nov 12, 2025
5e3ad82
chore: change comment
hominlee-wemade Nov 12, 2025
6f5846c
chore: remove comment
hominlee-wemade Nov 12, 2025
ea5800d
fix: adjust tip calculation logic
hominlee-wemade Nov 13, 2025
68e8698
fix: check EffectiveGasPrice
hominlee-wemade Nov 13, 2025
d564b97
test: add receipt derivation test for authorized account
hominlee-wemade Nov 13, 2025
5ba6f6f
refactor: use stateDB to determine authorized accounts instead of tem…
hominlee-wemade Nov 13, 2025
810605d
fix: handle nil minerFee when EffectiveGasPrice is missing
hominlee-wemade Nov 13, 2025
81e4a1d
Add StateReader interface for IsAuthorized checks in receipts
hominlee-wemade Nov 14, 2025
92aae3a
fix: test failure
hominlee-wemade Nov 14, 2025
4c8d1b8
test: add tx ordering benchmarks
hominlee-wemade Nov 14, 2025
a0fa097
refactor: remove unused baseFee argument from applyTransaction
hominlee-wemade Nov 17, 2025
57da6a6
feat: implement Anzeon fee policy in priceHeap
hominlee-wemade Nov 18, 2025
ea4d3aa
chore: change comment
hominlee-wemade Nov 18, 2025
4d2aa89
feat: implement temporary authorized account priority transaction ord…
hominlee-wemade Nov 11, 2025
aaf4be9
test: add test cases for authorized account transaction ordering
hominlee-wemade Nov 11, 2025
b780da4
chore: remove comment
hominlee-wemade Nov 11, 2025
cac1120
feat: update msg.GasTipCap handling in TransactionToMessage for autho…
hominlee-wemade Nov 12, 2025
04121e5
feat: pass stateDB as input parameter to TransactionToMessag
hominlee-wemade Nov 12, 2025
31485b7
feat: move effectiveGasPrice calculation for authorized accounts to a…
hominlee-wemade Nov 12, 2025
86ae900
test: add gas fee calculation tests for authorized and normal accounts
hominlee-wemade Nov 12, 2025
b6534ed
chore: change comment
hominlee-wemade Nov 12, 2025
d4cff59
chore: remove comment
hominlee-wemade Nov 12, 2025
8116c28
fix: adjust tip calculation logic
hominlee-wemade Nov 13, 2025
f211825
fix: check EffectiveGasPrice
hominlee-wemade Nov 13, 2025
b0bb2ce
test: add receipt derivation test for authorized account
hominlee-wemade Nov 13, 2025
845d9d4
refactor: use stateDB to determine authorized accounts instead of tem…
hominlee-wemade Nov 13, 2025
54deb6d
fix: handle nil minerFee when EffectiveGasPrice is missing
hominlee-wemade Nov 13, 2025
d3fff73
Add StateReader interface for IsAuthorized checks in receipts
hominlee-wemade Nov 14, 2025
a501177
fix: test failure
hominlee-wemade Nov 14, 2025
038e1e7
test: add tx ordering benchmarks
hominlee-wemade Nov 14, 2025
55a4ba8
refactor: remove unused baseFee argument from applyTransaction
hominlee-wemade Nov 17, 2025
cb18cc8
feat: implement Anzeon fee policy in priceHeap
hominlee-wemade Nov 18, 2025
0d52507
chore: change comment
hominlee-wemade Nov 18, 2025
7798c34
fix: refactor tx gas tip for anzeon spec
egonspace Nov 21, 2025
1201215
Merge branch 'feat/minter-priority-mempool' of https://github.com/sta…
egonspace Nov 21, 2025
c902a94
fix: lint error
egonspace Nov 21, 2025
311ee97
fix: test failure
egonspace Nov 21, 2025
08bc86f
fix: apply comment, and fix error
egonspace Nov 21, 2025
8f4376a
fix: test failure
egonspace Nov 23, 2025
854bbfd
fix: test failure
egonspace Nov 24, 2025
a3f1cbc
fix: all test pass
egonspace Nov 24, 2025
68b056d
fix: null check
egonspace Nov 24, 2025
21d4983
fix: apply comment
egonspace Nov 24, 2025
d39aa6b
fix: add zero-hash check before calling stateAt
hominlee-wemade Nov 28, 2025
9dd72c4
refactor: add effectiveGasPrice to receipt storage and restore legacy…
hominlee-wemade Dec 1, 2025
a5dbaa1
fix: race condition in gas price oracle goroutines
hominlee-wemade Dec 2, 2025
756344a
fix: effectiveGasPrice calculation when baseFee is nil
hominlee-wemade Dec 2, 2025
44db3bb
fix: restore AnzeonTipEnv to gasprice package
hominlee-wemade Dec 2, 2025
9d25116
fix: lint failure
hominlee-wemade Dec 2, 2025
f4818d2
core/gasprice: return nil base fee instead of zero value
hominlee-wemade Dec 2, 2025
167669e
fix: test failure
hominlee-wemade Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions cmd/devp2p/internal/ethtest/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) {
root: root,
startingHash: zero,
limitHash: ffHash,
expAccounts: 67,
expAccounts: 68,
expFirst: firstKey,
expLast: common.HexToHash("0x5602444769b5fd1ddfca48e3c38f2ecad326fe2433f22b90f6566a38496bd426"),
expLast: common.HexToHash("0x59312f89c13e9e24c1cb8b103aa39a9b2800348d97a92c2c9e2a78fa02b70025"),
desc: "In this test, we request the entire state range, but limit the response to 4000 bytes.",
},
{
Expand All @@ -99,7 +99,7 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) {
limitHash: ffHash,
expAccounts: 50,
expFirst: firstKey,
expLast: common.HexToHash("0x420a83d9891f19593cdda9b31bb3b450e960fa87042dd428a7fa5ee69db02c75"),
expLast: common.HexToHash("0x4363d332a0d4df8582a84932729892387c623fe1ec42e2cfcbe85c183ed98e0e"),
desc: "In this test, we request the entire state range, but limit the response to 3000 bytes.",
},
{
Expand All @@ -109,7 +109,7 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) {
limitHash: ffHash,
expAccounts: 34,
expFirst: firstKey,
expLast: common.HexToHash("0x2d425481284fbb1874a2c55d81564f371543b3b8f7450e860bc5381ba47b465f"),
expLast: common.HexToHash("0x2de4bdbddcfbb9c3e195dae6b45f9c38daff897e926764bf34887fb0db5c3284"),
desc: "In this test, we request the entire state range, but limit the response to 2000 bytes.",
},
{
Expand Down Expand Up @@ -178,9 +178,9 @@ The server should return the first available account.`,
root: root,
startingHash: firstKey,
limitHash: ffHash,
expAccounts: 67,
expAccounts: 68,
expFirst: firstKey,
expLast: common.HexToHash("0x5602444769b5fd1ddfca48e3c38f2ecad326fe2433f22b90f6566a38496bd426"),
expLast: common.HexToHash("0x59312f89c13e9e24c1cb8b103aa39a9b2800348d97a92c2c9e2a78fa02b70025"),
desc: `In this test, startingHash is exactly the first available account key.
The server should return the first available account of the state as the first item.`,
},
Expand All @@ -191,7 +191,7 @@ The server should return the first available account of the state as the first i
limitHash: ffHash,
expAccounts: 68,
expFirst: secondKey,
expLast: common.HexToHash("0x59312f89c13e9e24c1cb8b103aa39a9b2800348d97a92c2c9e2a78fa02b70025"),
expLast: common.HexToHash("0x59a7c8818f1c16b298a054020dc7c3f403a970d1d1db33f9478b1c36e3a2e509"),
desc: `In this test, startingHash is after the first available key.
The server should return the second account of the state as the first item.`,
},
Expand Down Expand Up @@ -229,7 +229,7 @@ server to return no data because genesis is older than 127 blocks.`,
limitHash: ffHash,
expAccounts: 66,
expFirst: firstKey,
expLast: common.HexToHash("0x792cc9f20a61c16646d5b6136693e7789549adb7d8e35503d0004130ea6528b0"),
expLast: common.HexToHash("0x7963685967117ffb6fd019663dc9e782ebb1234a38501bffc2eb5380f8dc303b"),
desc: `This test requests data at a state root that is 127 blocks old.
We expect the server to have this state available.`,
},
Expand Down Expand Up @@ -661,7 +661,7 @@ The server should reject the request.`,
// It's a bit unfortunate these are hard-coded, but the result depends on
// a lot of aspects of the state trie and can't be guessed in a simple
// way. So you'll have to update this when the test chain is changed.
common.HexToHash("0x9ac5b414913a065dfc5d56f7c20b5ee000e2cb6588e1a3ade1dd8c883d8e0db1"),
common.HexToHash("0x09d0a5a624c6cea221c43c9bfc83787d3098ffb81b5554464526e7f7a1e0a826"),
common.HexToHash("0x2b8c08122de89dadd4ca2c72f2cbc5e109b792bd82787a343713e3b632a77556"),
empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty,
empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty,
Expand All @@ -683,7 +683,7 @@ The server should reject the request.`,
expHashes: []common.Hash{
empty,
common.HexToHash("0x2b8c08122de89dadd4ca2c72f2cbc5e109b792bd82787a343713e3b632a77556"),
common.HexToHash("0x9ac5b414913a065dfc5d56f7c20b5ee000e2cb6588e1a3ade1dd8c883d8e0db1"),
common.HexToHash("0x09d0a5a624c6cea221c43c9bfc83787d3098ffb81b5554464526e7f7a1e0a826"),
},
},

Expand Down
Binary file modified cmd/devp2p/internal/ethtest/testdata/chain.rlp
Binary file not shown.
58 changes: 22 additions & 36 deletions cmd/devp2p/internal/ethtest/testdata/genesis.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions cmd/devp2p/internal/ethtest/testdata/headblock.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"parentHash": "0xa15410b625882ffe13cef2e30e6733c33c24404f770655c327f06276fda3e615",
"parentHash": "0x1acae07cba18f35533545765a20ba0073e105bd754bef5f42ecea25f1a272d3a",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0x7a2b5390bb632269133d3b7eda466b4b44bf2762",
"stateRoot": "0x6c95616f8f988fb794ba25b6027b4643f4cab89f03d19a317a26561bf07392cd",
"miner": "0x45dfd9f6da52abaee54ad49226c698e45b2f3777",
"stateRoot": "0x9f2b9986ee9bcd0a99033304705f7c6f4eb591b2612b6ffb99e6ce7f3882ea58",
"transactionsRoot": "0x3872575d14095b63f1ccf5e55b1548ffb68e1175d70cc7d39e8bfb24edbfda92",
"receiptsRoot": "0x71ac7511ee584f8bd35a714fbf557100955ffcc94bec4fd69a3133b6c3888eae",
"logsBloom": "0x00000200002000010000010000000000000000000000000000000004000000900000400000000000000000000000000044000000000000000000000000000000000000000000000000004008400500002000000200000000000100840000000000000420000000020001100000040000000000000000000200040010000000000000000000000000000001801000000000000400000000000000000000000400000000000000000040000000000000000000000000000000000000000000000000008002000000000040000000020000000000000000000000000000000000000000000000000000000001400004001200000000000000000000000000000000",
"receiptsRoot": "0x8cbf43991cfba05f524012a3d1815e02479bf3cc4b634e990a7da7cfb62b2a11",
"logsBloom": "0x00040200002000010000010000000000000000000000000000000004000000900000400000000000000000000800000044000000000000000000000000000000000000000000000000004008400100002000000000000000000100840000000000000420000000020001100000040000000010000000000200040010000000000000000000000000000001801000000000000400000000000000000000000400000000000000000040000000000000000000000000000000000000000000000000008002000000000040000000000000000000000000000000000000000000000000000000000000000001400004001200000000000000000000000000000000",
"difficulty": "0x1",
"number": "0x1f4",
"gasLimit": "0x23f3e20",
"gasUsed": "0xfc61",
"timestamp": "0x1388",
"extraData": "0xf90252a00000000000000000000000000000000000000000000000000000000000000000b84104146ab708521c17112a712b4841242fd815cea407439ee9921ecd133c7824da4f3e87c915311a82c30225153c8ec9bb24a108fb3bb524d8f4d24205053929180180f86301b860b82c5e057b94ba284bf2e1c72aa1be8bd98a1758003bbb5a13f998917da913d39f0cceabef42d7017c282bcabd47a52110a7cd965931eaf250774e244810a92301b7030601022e3f657619bb9167cbe9719e63298ee4a07f1be6208e5d3fa662f86301b860a9c92e8e6b63384301858395e2af6a6c4b0bee2ab8735afe57327fd6f2252aef74c59b1e2604f08941423515bf617e40003fc0c9374f6fc5799ec94026689bcc51eec82e8c2d6cf651df32b0f7115bf086b91bb680aed31d4fcc55ab5b16d2cc80f86301b860b9a95dbfb04976e9f428199a6b1f54ffaa8cc07e2037952a8e4296172ee6ad7955c903207a26d610cef47fe7ecd940ea0584dbcf58846d7d423d438297b8d3bb483cec136c6efac66a1b6f2a9e6fb714bf21e262093f4f6e07b7c65c661f6502f86301b860a2a281fdbd6b753ad3d7ffdf23981e74d47fb31e938a6bcce354ba5e3d8ab5682432f0eff767ff0b0ec6e12b42a44c961672f63f1151900e4e588a448352cb01eac18d5534343f576133dfda5d94e1a5a885a38723a53a1c64e80448ca9ce4d186048c27395000f84fdad9947a2b5390bb632269133d3b7eda466b4b44bf2762831e8272c180f1b097c400fd91b90fa95292799990277b547df8b87cb866c2e77ac0e0ffa2a6558ef7087a0785870202c45dd49c5de147b3",
"mixHash": "0x1abd716350517c438bc1671a73af2e285baabea8541ced8f0ed9eeb8fd31dccb",
"extraData": "0xf90252a00000000000000000000000000000000000000000000000000000000000000000b841c03c0aeae78257456db9b1a33f953fd10edd9ec061496eeaf6adb1cd43954f527f7a984ebdec5049422044ae77f5033d869a84d442b076e072c14be8eec6f6ff0180f86301b8608c8ef357caafeac2003cead9edaad94202761a87bd2edffce3261e0396176f9559dd02a71887061d354af0220a4c1a460cc3926eab2be9ed38995a66e549db154ad27a2772c1fa17a5f826685831c7e14a8e1a884acf24c47e25a652431c4357f86301b86097810d10d423f3c8f067b48082cd19aa92708d85eed96a500ac14211b32bbd92ebfd5d0ea31ae60c687f20174e7eb31f0282bf22bde1600c056717b2bf861839185ba7df560d7ff9429a0abf0a79f8d30b198d1e05636a02e78520acf09f1f6880f86301b860957faca68736bf2e6270d3b9b223c56eea95c14b46d53540d5b7c789f903d70aad20a0597bd556daabf8dfb663aad6570b0f01a4ff0e6ea5da31efdeff9015cd9d893d67b26ee326e30476fb6bcc7f8c6574e812b8e0aa21fea50603c5b35479f86301b860adc8900c57e770c6215bf79378dec5db7c688cdc6f66bd68f05a9c6d173a635184663018485bac99d4092c69d7f894020d54e5f09bfb9e00d43d1fc12c620ffdd5215f69eb2980eccda1307b6e2a7d423394cdc754283932d5320d5ecfba5f8c86048c27395000f84fdad99445dfd9f6da52abaee54ad49226c698e45b2f3777831e8272c180f1b092272a6e9692aa2ffe724257fe911e17189c5081b73c55ba1aacbd81248b6261fbfc5578c46407b94ba8dcdf6f8c926b",
"mixHash": "0x00f2edc2326d5ba58a90a3418bfc9c4dc8f0da3fb462fdc2ae67411a2820d390",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x48c27395000",
"withdrawalsRoot": null,
"blobGasUsed": null,
"excessBlobGas": null,
"parentBeaconBlockRoot": null,
"hash": "0x5963f533df1abbcf81b0e74089902c77112c129855f09a26dbd15e5d034dbf61"
"hash": "0x6cbff26011501e62103a791266876e8af1a5399b7b9aaa37de3abe2a9e56d2de"
}
6 changes: 3 additions & 3 deletions cmd/devp2p/internal/ethtest/testdata/headfcu.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"method": "engine_forkchoiceUpdatedV1",
"params": [
{
"headBlockHash": "0x5963f533df1abbcf81b0e74089902c77112c129855f09a26dbd15e5d034dbf61",
"safeBlockHash": "0x5963f533df1abbcf81b0e74089902c77112c129855f09a26dbd15e5d034dbf61",
"finalizedBlockHash": "0x5963f533df1abbcf81b0e74089902c77112c129855f09a26dbd15e5d034dbf61"
"headBlockHash": "0x6cbff26011501e62103a791266876e8af1a5399b7b9aaa37de3abe2a9e56d2de",
"safeBlockHash": "0x6cbff26011501e62103a791266876e8af1a5399b7b9aaa37de3abe2a9e56d2de",
"finalizedBlockHash": "0x6cbff26011501e62103a791266876e8af1a5399b7b9aaa37de3abe2a9e56d2de"
},
null
]
Expand Down
56 changes: 24 additions & 32 deletions cmd/devp2p/internal/ethtest/testdata/headstate.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
rejectedTxs = append(rejectedTxs, &rejectedTx{i, errMsg})
continue
}
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee, nil)
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee, nil, statedb)
if err != nil {
log.Warn("rejected tx", "index", i, "hash", tx.Hash(), "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
Expand Down Expand Up @@ -284,6 +284,11 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
//receipt.BlockHash
//receipt.BlockNumber
receipt.TransactionIndex = uint(txIndex)

if chainConfig.AnzeonEnabled() {
receipt.EffectiveGasPrice = msg.GasPrice
}

receipts = append(receipts, receipt)
}

Expand Down
7 changes: 1 addition & 6 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2115,12 +2115,7 @@ func (bc *BlockChain) collectLogs(b *types.Block, removed bool) []*types.Log {
}
receipts := rawdb.ReadRawReceipts(bc.db, b.Hash(), b.NumberU64())

var headerGasTip *big.Int
if b.Header() != nil && b.Header().GasTip() != nil {
headerGasTip = b.Header().GasTip()
}

if err := receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), headerGasTip, blobGasPrice, b.Transactions()); err != nil {
if err := receipts.DeriveFields(bc.chainConfig, b.Hash(), b.NumberU64(), b.Time(), b.BaseFee(), blobGasPrice, b.Transactions()); err != nil {
log.Error("Failed to derive block receipts fields", "hash", b.Hash(), "number", b.NumberU64(), "err", err)
}
var logs []*types.Log
Expand Down
1 change: 1 addition & 0 deletions core/blockchain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func (bc *BlockChain) GetReceiptsByHash(hash common.Hash) types.Receipts {
if header == nil {
return nil
}

receipts := rawdb.ReadReceipts(bc.db, hash, *number, header.Time, bc.chainConfig)
if receipts == nil {
return nil
Expand Down
7 changes: 1 addition & 6 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
blobGasPrice = eip4844.CalcBlobFee(*block.ExcessBlobGas())
}

var headerGasTip *big.Int
if block.Header() != nil && block.Header().GasTip() != nil {
headerGasTip = block.Header().GasTip()
}

if err := receipts.DeriveFields(config, block.Hash(), block.NumberU64(), block.Time(), block.BaseFee(), headerGasTip, blobGasPrice, txs); err != nil {
if err := receipts.DeriveFields(config, block.Hash(), block.NumberU64(), block.Time(), block.BaseFee(), blobGasPrice, txs); err != nil {
panic(err)
}

Expand Down
12 changes: 6 additions & 6 deletions core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import (
"golang.org/x/exp/slices"
)

// StateReader is an alias for types.StateReader to maintain backward compatibility.
// The interface is defined in types package to avoid circular dependencies.
type StateReader = types.StateReader

// ReadCanonicalHash retrieves the hash assigned to a canonical block number.
func ReadCanonicalHash(db ethdb.Reader, number uint64) common.Hash {
var data []byte
Expand Down Expand Up @@ -649,12 +653,7 @@ func ReadReceipts(db ethdb.Reader, hash common.Hash, number uint64, time uint64,
blobGasPrice = eip4844.CalcBlobFee(*header.ExcessBlobGas)
}

var headerGasTip *big.Int
if header != nil && header.GasTip() != nil {
headerGasTip = new(big.Int).Set(header.GasTip())
}

if err := receipts.DeriveFields(config, hash, number, time, baseFee, headerGasTip, blobGasPrice, body.Transactions); err != nil {
if err := receipts.DeriveFields(config, hash, number, time, baseFee, blobGasPrice, body.Transactions); err != nil {
log.Error("Failed to derive block receipts fields", "hash", hash, "number", number, "err", err)
return nil
}
Expand Down Expand Up @@ -692,6 +691,7 @@ type storedReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
Logs []*types.Log
EffectiveGasPrice *big.Int `rlp:"optional"`
}

// ReceiptLogs is a barebone version of ReceiptForStorage which only keeps
Expand Down
28 changes: 16 additions & 12 deletions core/rawdb/accessors_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,10 @@ func TestBlockReceiptStorage(t *testing.T) {
{Address: common.BytesToAddress([]byte{0x11})},
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
},
TxHash: tx1.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
GasUsed: 111111,
EffectiveGasPrice: big.NewInt(10000000000000),
TxHash: tx1.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
GasUsed: 111111,
}
receipt1.Bloom = types.CreateBloom(types.Receipts{receipt1})

Expand All @@ -370,9 +371,10 @@ func TestBlockReceiptStorage(t *testing.T) {
{Address: common.BytesToAddress([]byte{0x22})},
{Address: common.BytesToAddress([]byte{0x02, 0x22})},
},
TxHash: tx2.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}),
GasUsed: 222222,
EffectiveGasPrice: big.NewInt(10000000000000),
TxHash: tx2.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}),
GasUsed: 222222,
}
receipt2.Bloom = types.CreateBloom(types.Receipts{receipt2})
receipts := []*types.Receipt{receipt1, receipt2}
Expand Down Expand Up @@ -705,9 +707,10 @@ func TestReadLogs(t *testing.T) {
{Address: common.BytesToAddress([]byte{0x11})},
{Address: common.BytesToAddress([]byte{0x01, 0x11})},
},
TxHash: tx1.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
GasUsed: 111111,
TxHash: tx1.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x01, 0x11, 0x11}),
EffectiveGasPrice: big.NewInt(10000000000000),
GasUsed: 111111,
}
receipt1.Bloom = types.CreateBloom(types.Receipts{receipt1})

Expand All @@ -718,9 +721,10 @@ func TestReadLogs(t *testing.T) {
{Address: common.BytesToAddress([]byte{0x22})},
{Address: common.BytesToAddress([]byte{0x02, 0x22})},
},
TxHash: tx2.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}),
GasUsed: 222222,
TxHash: tx2.Hash(),
ContractAddress: common.BytesToAddress([]byte{0x02, 0x22, 0x22}),
EffectiveGasPrice: big.NewInt(10000000000000),
GasUsed: 222222,
}
receipt2.Bloom = types.CreateBloom(types.Receipts{receipt2})
receipts := []*types.Receipt{receipt1, receipt2}
Expand Down
2 changes: 1 addition & 1 deletion core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
}

// Convert the transaction into an executable message and pre-cache its sender
msg, err := TransactionToMessage(tx, signer, header.BaseFee, header.GasTip())
msg, err := TransactionToMessage(tx, signer, header.BaseFee, header.GasTip(), statedb)
if err != nil {
return // Also invalid block, bail out
}
Expand Down
8 changes: 6 additions & 2 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
}
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
msg, err := TransactionToMessage(tx, signer, header.BaseFee, header.GasTip())
msg, err := TransactionToMessage(tx, signer, header.BaseFee, header.GasTip(), statedb)
if err != nil {
return nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
}
Expand Down Expand Up @@ -153,6 +153,10 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
receipt.BlockHash = blockHash
receipt.BlockNumber = blockNumber
receipt.TransactionIndex = uint(statedb.TxIndex())

if config.AnzeonEnabled() {
receipt.EffectiveGasPrice = msg.GasPrice
}
return receipt, err
}

Expand All @@ -161,7 +165,7 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
// for the transaction, gas used and an error if the transaction failed,
// indicating the block was invalid.
func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) {
msg, err := TransactionToMessage(tx, types.MakeSigner(config, header.Number, header.Time), header.BaseFee, header.GasTip())
msg, err := TransactionToMessage(tx, types.MakeSigner(config, header.Number, header.Time), header.BaseFee, header.GasTip(), statedb)
if err != nil {
return nil, err
}
Expand Down
Loading