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

qng master #45

Merged
merged 103 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
5b74de5
Support customization consensus engine
lochjin Nov 16, 2021
37caa54
go.mod : fix go-duktape warning
dindinw Dec 12, 2021
2e60b53
Merge pull request #1 from dindinw/v1.10.9-qng
dindinw Dec 12, 2021
c2e721e
eth/tracers: fix go-duktape warning
dindinw Dec 12, 2021
5dd0feb
Merge pull request #2 from dindinw/v1.10.9-qng
dindinw Dec 12, 2021
13b32c0
go.sum done go.mod tidy
dindinw Dec 12, 2021
2a2d194
Merge pull request #3 from dindinw/v1.10.9-qng
dindinw Dec 12, 2021
5a818d0
Support RemoveTx for pool
lochjin Jan 4, 2022
00b4ecb
Merge pull request #4 from lochjin/v1.10.9-qng
dindinw Jan 4, 2022
ca2e573
Expose web3 interface
lochjin Feb 10, 2022
29cefce
optimize c
lochjin Feb 10, 2022
21f3178
Merge pull request #5 from lochjin/v1.10.9-qng
dindinw Feb 10, 2022
f092f20
Delete dependency about docker
lochjin Feb 17, 2022
b6911f1
Merge pull request #6 from lochjin/v1.10.9-qng
dindinw Feb 17, 2022
07a4b97
core/statedb: always clear out access list when setting a new one
karalabe Mar 8, 2022
8716f82
Merge pull request #7 from lochjin/v1.10.9-qng
dindinw Mar 18, 2022
ba54898
BUG:tx pool multi thread lock conflict
lochjin Mar 22, 2022
e6f3b20
Merge pull request #8 from lochjin/v1.10.9-qng
dindinw Mar 22, 2022
3f851b2
Support external proxy for miner
lochjin Mar 22, 2022
f4e00ac
Merge pull request #9 from lochjin/v1.10.9-qng
dindinw Mar 22, 2022
76b83e2
Merge branch 'hlc-v1.10.9-qng' into v1.10.18-qng
lochjin Jun 10, 2022
e3fc7f6
optimize miner interface for new version
lochjin Jun 10, 2022
25e02ea
Merge qng customized func
lochjin Aug 16, 2022
f20bb40
Remove fork info and optimize ethcatalyst
lochjin Aug 18, 2022
d0dc349
graphql: return correct logs for tx (#25612)
s1na Aug 31, 2022
3b41be6
graphql: fixes missing tx logs (#25745)
s1na Sep 13, 2022
972007a
Release Geth v1.10.24
karalabe Sep 14, 2022
8f61fc8
params: set TerminalTotalDifficultyPassed to true (#25769)
MariusVanDerWijden Sep 15, 2022
69568c5
params: release Geth v1.10.25
karalabe Sep 15, 2022
cf51cba
usbwallet support Ledger Nano S Plus
lochjin Oct 5, 2022
85e469f
eth/protocols/snap: fix problems due to idle-but-busy peers (#25651)
holiman Aug 31, 2022
937ea49
eth/protocols/snap: throttle trie heal requests when peers DoS us (#2…
karalabe Sep 9, 2022
a32e69a
trie: check childrens' existence concurrently for snap heal (#25694)
karalabe Sep 6, 2022
99bbb33
eth: fix a rare datarace on CHT challenge reply / shutdown (#25831)
karalabe Sep 20, 2022
27600a5
eth/filters: change filter block to be by-ref (#26054)
holiman Oct 27, 2022
211dbb7
rpc: handle wrong HTTP batch response length (#26064)
jmank88 Nov 2, 2022
e5eb32a
params: release geth v1.10.26 stable
fjl Nov 3, 2022
9d7896c
merge from qng
lochjin Nov 8, 2022
8be7970
Merge pull request #14 from lochjin/v1.10.26-qng
dindinw Nov 8, 2022
76f1bb8
core/state: replace fastcache code cache with gc-friendly structure (…
holiman Nov 9, 2022
354b6a7
common/lru: fix race in lru (#26164)
holiman Nov 11, 2022
283fb4e
core/rawdb: fix freezer validation (#26251)
rjl493456442 Nov 25, 2022
31ed802
core/rawdb: improve freezerTable.Sync (#26245)
fjl Nov 24, 2022
9f7a46f
Merge pull request #18 from lochjin/v1.10.26-qng
dindinw Nov 30, 2022
3d579f5
expose GlobalBig
lochjin Jan 9, 2023
473b092
Merge pull request #19 from lochjin/v1.10.26-qng
dindinw Jan 9, 2023
d3774ab
merge qng
lochjin Mar 12, 2023
a7e8e2c
MeerChainConfig
lochjin Mar 28, 2023
814a356
Merge branch v1.11.5 qng
lochjin Mar 29, 2023
4616f37
BUG:ChainConfig Description error
lochjin Apr 1, 2023
c4e76b0
Support QngEIPsBanner
lochjin Apr 1, 2023
ac3804c
Optimize QngEIPsBanner
lochjin Apr 1, 2023
928e85f
BUG:chain id compare
lochjin Apr 1, 2023
f8dcbda
internal/web3ext: fix parameter count of miner_start (#27400)
lochjin Jun 1, 2023
bcd6ea6
Merge qng
lochjin Jun 1, 2023
fefd13d
txpool for qng
lochjin Jun 1, 2023
3ddc148
Merge pull request #27 from lochjin/v1.12.0-qng
dindinw Jun 2, 2023
2d5644b
txpool:reheap the priced list if london fork not enabled
lochjin Jun 15, 2023
9e83ad1
Merge pull request #28 from lochjin/v1.12.0-qng
dindinw Jun 16, 2023
8a933a5
core/txpool: handle missing head in reset
lochjin Jul 6, 2023
9e2eef8
Merge pull request #30 from lochjin/v1.12.0-qng
dindinw Jul 6, 2023
a0491a0
deps: update supranational/blst to 0.3.11 (#27890)
dependabot[bot] Aug 10, 2023
55863ce
core/txpool/blobpool: fix metrics name for prometheus export (#27901)
imulmat4 Aug 11, 2023
770db14
ethdb/leveldb: support more than 7 levels in metrics (#27904)
jsvisa Aug 11, 2023
811a674
all: update golang/x/ext and fix slice sorting fallout (#27909)
karalabe Aug 11, 2023
f298ec4
go.mod, build: upgrade c-kzg-4844 (#27907)
fjl Aug 11, 2023
a867039
internal/build: apply -ubuntu to env (#27910)
fjl Aug 12, 2023
bed8460
params: release go-ethereum v1.12.2
fjl Aug 12, 2023
1b8cb51
Megre qng
lochjin Sep 11, 2023
4ea6c11
Optimize miner for qng
lochjin Sep 13, 2023
59ad32a
Merge v1.13.0
lochjin Sep 13, 2023
a983ecc
Merge pull request #32 from lochjin/v1.13.0-qng
dindinw Sep 14, 2023
5176db9
Merge branch 'v1.13.0' into v1.13.1
lochjin Sep 18, 2023
19a9262
Merge branch qng
lochjin Nov 5, 2023
d9ad391
Merge pull request #34 from lochjin/v1.13.4-qng
dindinw Nov 5, 2023
916d6a4
params: release Geth v1.15.5
karalabe Nov 14, 2023
8597496
Upgrade v1.13.5
lochjin Nov 16, 2023
7b5e6e7
Merge pull request #35 from lochjin/v1.13.5-qng
dindinw Nov 16, 2023
5ba3d57
Merge branch 'release/1.13' into release-1.13.6
fjl Dec 18, 2023
da6cdaf
all: release go-ethereum v1.13.6
fjl Dec 18, 2023
c3d9ca6
all: release go-ethereum v1.13.7
fjl Dec 19, 2023
412aa33
qng
lochjin Dec 20, 2023
6fb31d2
Merge pull request #36 from lochjin/v1.13.7-qng
dindinw Dec 21, 2023
b20b4a7
all: release go-ethereum v1.13.8
holiman Dec 22, 2023
2a41796
Merge branch 'qng' into v1.13.8-qng
lochjin Dec 26, 2023
26d7dfd
Merge pull request #37 from lochjin/v1.13.8-qng
dindinw Dec 26, 2023
dd938d1
Merge branch 'master' into release/1.13
fjl Jan 10, 2024
bc0be1b
Merge branch 'master' into release/1.13
karalabe Jan 11, 2024
8f7eb9c
all: release go-ethereum v1.13.11 (#28868)
holiman Jan 24, 2024
02eb36a
all: release go-ethereum v1.13.12 (#28961)
holiman Feb 9, 2024
7f131dc
Merge branch 'master' into release/1.13
fjl Feb 21, 2024
2bd6bd0
Merge branch 'master' into release/1.13
karalabe Feb 27, 2024
78c0793
Merge branch v1.13.14-qng
lochjin Mar 18, 2024
d4c2f91
API for qng
lochjin Mar 18, 2024
06045ed
Merge pull request #38 from lochjin/v1.13.14-qng
dindinw Mar 18, 2024
2bc6650
qng interface
lochjin May 9, 2024
d1d4e60
go-secp256k1
lochjin May 10, 2024
77e64a7
Merge pull request #41 from lochjin/v1.14.2-qng
dindinw May 12, 2024
b08c013
BUG:Unnecessary prompts about zero state root hash
lochjin May 14, 2024
2f3cd58
Merge pull request #42 from lochjin/v1.14.2-qng
dindinw May 14, 2024
43b4a22
BUG:default consensus engine is nil
lochjin May 18, 2024
3e4823d
Engine API for qng
lochjin May 21, 2024
58aa722
Merge branch master
lochjin May 22, 2024
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
4 changes: 3 additions & 1 deletion beacon/engine/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type ExecutableData struct {
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *uint64 `json:"blobGasUsed"`
ExcessBlobGas *uint64 `json:"excessBlobGas"`
Difficulty *big.Int `json:"difficulty"`
}

// JSON type overrides for executableData.
Expand Down Expand Up @@ -237,7 +238,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
TxHash: types.DeriveSha(types.Transactions(txs), trie.NewStackTrie(nil)),
ReceiptHash: params.ReceiptsRoot,
Bloom: types.BytesToBloom(params.LogsBloom),
Difficulty: common.Big0,
Difficulty: params.Difficulty,
Number: new(big.Int).SetUint64(params.Number),
GasLimit: params.GasLimit,
GasUsed: params.GasUsed,
Expand Down Expand Up @@ -278,6 +279,7 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types.
Withdrawals: block.Withdrawals(),
BlobGasUsed: block.BlobGasUsed(),
ExcessBlobGas: block.ExcessBlobGas(),
Difficulty: block.Difficulty(),
}
bundle := BlobsBundleV1{
Commitments: make([]hexutil.Bytes, 0),
Expand Down
69 changes: 69 additions & 0 deletions beacon/engine/types_qng.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package engine

import (
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/trie"
"math/big"
)

func ExecutableDataToBlockQng(params ExecutableData, versionedHashes []common.Hash, beaconRoot *common.Hash) (*types.Block, error) {
txs, err := decodeTransactions(params.Transactions)
if err != nil {
return nil, err
}
if len(params.LogsBloom) != 256 {
return nil, fmt.Errorf("invalid logsBloom length: %v", len(params.LogsBloom))
}
// Check that baseFeePerGas is not negative or too big
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
}
var blobHashes []common.Hash
for _, tx := range txs {
blobHashes = append(blobHashes, tx.BlobHashes()...)
}
if len(blobHashes) != len(versionedHashes) {
return nil, fmt.Errorf("invalid number of versionedHashes: %v blobHashes: %v", versionedHashes, blobHashes)
}
for i := 0; i < len(blobHashes); i++ {
if blobHashes[i] != versionedHashes[i] {
return nil, fmt.Errorf("invalid versionedHash at %v: %v blobHashes: %v", i, versionedHashes, blobHashes)
}
}
// Only set withdrawalsRoot if it is non-nil. This allows CLs to use
// ExecutableData before withdrawals are enabled by marshaling
// Withdrawals as the json null value.
var withdrawalsRoot *common.Hash
if params.Withdrawals != nil {
h := types.DeriveSha(types.Withdrawals(params.Withdrawals), trie.NewStackTrie(nil))
withdrawalsRoot = &h
}
header := &types.Header{
ParentHash: params.ParentHash,
UncleHash: types.EmptyUncleHash,
Coinbase: params.FeeRecipient,
Root: params.StateRoot,
TxHash: types.DeriveSha(types.Transactions(txs), trie.NewStackTrie(nil)),
ReceiptHash: params.ReceiptsRoot,
Bloom: types.BytesToBloom(params.LogsBloom),
Difficulty: params.Difficulty,
Number: new(big.Int).SetUint64(params.Number),
GasLimit: params.GasLimit,
GasUsed: params.GasUsed,
Time: params.Timestamp,
BaseFee: params.BaseFeePerGas,
Extra: params.ExtraData,
MixDigest: params.Random,
WithdrawalsHash: withdrawalsRoot,
ExcessBlobGas: params.ExcessBlobGas,
BlobGasUsed: params.BlobGasUsed,
ParentBeaconRoot: beaconRoot,
}
block := types.NewBlockWithHeader(header).WithBody(types.Body{Transactions: txs, Uncles: nil, Withdrawals: params.Withdrawals})
if block.Hash() != params.BlockHash {
return nil, fmt.Errorf("blockhash mismatch, want %x, got %x", params.BlockHash, block.Hash())
}
return block, nil
}
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
if err != nil {
Fatalf("%v", err)
}
engine, err := ethconfig.CreateConsensusEngine(config, chainDb)
engine, err := ethconfig.CreateDefaultConsensusEngine(config, chainDb)
if err != nil {
Fatalf("%v", err)
}
Expand Down
5 changes: 4 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,14 @@ func (bc *BlockChain) rewindPathHead(head *types.Header, root common.Hash) (*typ

// noState represents if the target state requested for search
// is unavailable and impossible to be recovered.
noState = !bc.HasState(root) && !bc.stateRecoverable(root)
noState = root == common.Hash{}

start = time.Now() // Timestamp the rewinding is restarted
logged = time.Now() // Timestamp last progress log was printed
)
if !noState {
noState = !bc.HasState(root) && !bc.stateRecoverable(root)
}
// Rewind the head block tag until an available state is found.
for {
logger := log.Trace
Expand Down
20 changes: 20 additions & 0 deletions core/txpool/legacypool/legacypool_qng.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package legacypool

import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)

func (pool *LegacyPool) RemoveTx(hash common.Hash, outofbound bool) {
pool.mu.Lock()
defer pool.mu.Unlock()
pool.removeTx(hash, outofbound, true)
}

func (pool *LegacyPool) All() *lookup {
return pool.all
}

func (pool *LegacyPool) AddRemotesSync(txs []*types.Transaction) []error {
return pool.addRemotesSync(txs)
}
5 changes: 5 additions & 0 deletions core/txpool/txpool_qng.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package txpool

func (p *TxPool) Subpools() []SubPool {
return p.subpools
}
2 changes: 1 addition & 1 deletion crypto/signature_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"errors"
"fmt"

secp256k1 "github.com/Qitmeer/go-secp256k1"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
)

// Ecrecover returns the uncompressed public key that created the given signature.
Expand Down
16 changes: 12 additions & 4 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type Ethereum struct {

APIBackend *EthAPIBackend

miner *miner.Miner
miner miner.IMiner
gasPrice *big.Int

networkID uint64
Expand Down Expand Up @@ -146,7 +146,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if err != nil {
return nil, err
}
engine, err := ethconfig.CreateConsensusEngine(chainConfig, chainDb)
if config.ConsensusEngine == nil {
config.ConsensusEngine = ethconfig.CreateDefaultConsensusEngine
}
engine, err := config.ConsensusEngine(chainConfig, chainDb)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -260,7 +263,12 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
return nil, err
}

eth.miner = miner.New(eth, config.Miner, eth.engine)
if config.Miner.External == nil {
eth.miner = miner.New(eth, config.Miner, eth.engine)
} else {
eth.miner = config.Miner.External
}

eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData))

eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil}
Expand Down Expand Up @@ -348,7 +356,7 @@ func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
s.blockchain.ResetWithGenesisBlock(gb)
}

func (s *Ethereum) Miner() *miner.Miner { return s.miner }
func (s *Ethereum) Miner() miner.IMiner { return s.miner }

func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager }
func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain }
Expand Down
Loading
Loading