diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c90a52b2141..8ec1538ff192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ # Changelog +## v1.2.14 +BUGFIX +fix: remove sharedPool + +## v1.2.13 +IMPROVEMENT +* [\#1954](https://github.com/bnb-chain/bsc/pull/1954) performance: keep trie prefetch during validation phase + +BUGFIX +* [\#1950](https://github.com/bnb-chain/bsc/pull/1950) fix: 2 APIs of get receipt related(#1950) + ## v1.2.12 FEATURE * [\#1852](https://github.com/bnb-chain/bsc/pull/1852) discov: add hardcoded bootnodes diff --git a/core/state/state_object.go b/core/state/state_object.go index 5be38fa0bb7d..f9604306ceba 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -166,20 +166,20 @@ func (s *StateObject) getTrie(db Database) Trie { if s.trie == nil { // Try fetching from prefetcher first // We don't prefetch empty tries - prefetcher := s.db.prefetcher - if s.data.Root != emptyRoot && prefetcher != nil { - // When the miner is creating the pending state, there is no - // prefetcher - s.trie = prefetcher.trie(s.data.Root) - } - if s.trie == nil { - var err error - s.trie, err = db.OpenStorageTrie(s.addrHash, s.data.Root) - if err != nil { - s.trie, _ = db.OpenStorageTrie(s.addrHash, common.Hash{}) - s.setError(fmt.Errorf("can't create storage trie: %v", err)) - } + // prefetcher := s.db.prefetcher + // if s.data.Root != emptyRoot && prefetcher != nil { + // When the miner is creating the pending state, there is no + // prefetcher + // s.trie = prefetcher.trie(s.data.Root) + // } + // if s.trie == nil { + var err error + s.trie, err = db.OpenStorageTrie(s.addrHash, s.data.Root) + if err != nil { + s.trie, _ = db.OpenStorageTrie(s.addrHash, common.Hash{}) + s.setError(fmt.Errorf("can't create storage trie: %v", err)) } + // } } return s.trie } diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index 5d2edf33018b..9ff24efd9c00 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -60,7 +60,9 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c for i := 0; i < prefetchThread; i++ { go func() { newStatedb := statedb.CopyDoPrefetch() - newStatedb.EnableWriteOnSharedStorage() + if header.Number.Uint64() < 33968300 { + newStatedb.EnableWriteOnSharedStorage() + } gaspool := new(GasPool).AddGas(block.GasLimit()) blockContext := NewEVMBlockContext(header, p.bc, nil) evm := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, *cfg, firehose.NoOpContext) @@ -106,7 +108,9 @@ func (p *statePrefetcher) PrefetchMining(txs *types.TransactionsByPriceAndNonce, go func(startCh <-chan *types.Transaction, stopCh <-chan struct{}) { idx := 0 newStatedb := statedb.CopyDoPrefetch() - newStatedb.EnableWriteOnSharedStorage() + if header.Number.Uint64() < 33968300 { + newStatedb.EnableWriteOnSharedStorage() + } gaspool := new(GasPool).AddGas(gasLimit) blockContext := NewEVMBlockContext(header, p.bc, nil) evm := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg, firehose.NoOpContext) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index b1d738e28635..e9acdcb26807 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -2000,10 +2000,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceiptsByBlockNumber(ctx conte txReceipts := make([]map[string]interface{}, 0, len(txs)) for idx, receipt := range receipts { tx := txs[idx] - var signer types.Signer = types.FrontierSigner{} - if tx.Protected() { - signer = types.NewEIP155Signer(tx.ChainId()) - } + signer := types.MakeSigner(s.b.ChainConfig(), block.Number()) from, _ := types.Sender(signer, tx) fields := map[string]interface{}{ @@ -2018,6 +2015,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceiptsByBlockNumber(ctx conte "contractAddress": nil, "logs": receipt.Logs, "logsBloom": receipt.Bloom, + "type": hexutil.Uint(tx.Type()), } // Assign receipt status or post state. @@ -2091,6 +2089,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionDataAndReceipt(ctx context.Cont "contractAddress": nil, "logs": receipt.Logs, "logsBloom": receipt.Bloom, + "type": hexutil.Uint(tx.Type()), } // Assign receipt status or post state. diff --git a/params/version.go b/params/version.go index a6b3d84ac1ce..7b084ddfc751 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 2 // Minor version component of the current release - VersionPatch = 12 // Patch version component of the current release + VersionPatch = 14 // Patch version component of the current release VersionMeta = "fh2.2" // Version metadata to append to the version string FirehoseVersionMajor = 2