Skip to content

Commit

Permalink
upstream: fix CIs for merging geth-master-0205
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 committed Feb 6, 2025
1 parent df229e7 commit 57df7a0
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 151 deletions.
10 changes: 2 additions & 8 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2140,19 +2140,13 @@ func TestGolangBindings(t *testing.T) {
t.Fatalf("failed to replace tendermint dependency to bnb-chain source: %v\n%s", err, out)
}

replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/cometbft/[email protected]", "-replace", "github.com/cometbft/cometbft=github.com/bnb-chain/greenfield-[email protected]") // Repo root
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/cometbft/[email protected]", "-replace", "github.com/cometbft/cometbft=github.com/bnb-chain/greenfield-[email protected]") // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace cometbft dependency to bnb-chain source: %v\n%s", err, out)
}

replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/syndtr/[email protected]", "-replace", "github.com/syndtr/goleveldb=github.com/syndtr/[email protected]")
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace cometbft dependency to bnb-chain source: %v\n%s", err, out)
}

tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.21")
tidier := exec.Command(gocmd, "mod", "tidy")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)
Expand Down
4 changes: 3 additions & 1 deletion core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon

// Set the terminal total difficulty in the config
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
chain.Config().TerminalTotalDifficulty = gspec.Config.TerminalTotalDifficulty
}
genDb, blocks, _ := GenerateChainWithGenesis(gspec, engine, 2*state.TriesInMemory, func(i int, gen *BlockGen) {
tx, err := types.SignTx(types.NewTransaction(nonce, common.HexToAddress("deadbeef"), big.NewInt(100), 21000, big.NewInt(int64(i+1)*params.GWei), nil), signer, key)
Expand Down Expand Up @@ -2018,6 +2019,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
ttd := big.NewInt(int64(len(blocks)))
ttd.Mul(ttd, params.GenesisDifficulty)
gspec.Config.TerminalTotalDifficulty = ttd
chain.Config().TerminalTotalDifficulty = gspec.Config.TerminalTotalDifficulty
mergeBlock = len(blocks)
}

Expand Down Expand Up @@ -4240,7 +4242,7 @@ func TestParliaBlobFeeReward(t *testing.T) {
signer := types.LatestSigner(config)

_, bs, _ := GenerateChainWithGenesis(gspec, engine, 1, func(i int, gen *BlockGen) {
tx, _ := makeMockTx(config, signer, testKey, gen.TxNonce(testAddr), gen.BaseFee().Uint64(), eip4844.CalcBlobFee(config, gen.HeadBlock()).Uint64(), false)
tx, _ := makeMockTx(config, signer, testKey, gen.TxNonce(testAddr), gen.BaseFee().Uint64(), 0, false)
gen.AddTxWithChain(chain, tx)
tx, sidecar := makeMockTx(config, signer, testKey, gen.TxNonce(testAddr), gen.BaseFee().Uint64(), eip4844.CalcBlobFee(config, gen.HeadBlock()).Uint64(), true)
gen.AddTxWithChain(chain, tx)
Expand Down
1 change: 1 addition & 0 deletions core/rawdb/freezer_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ func (t *freezerTable) resetItems(startAt uint64) (*freezerTable, error) {
t.releaseFile(0)

// overwrite metadata file
t.metadata.setVirtualTail(startAt, false)
if err := t.metadata.write(true); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ func (pool *LegacyPool) transferTransactions() {
return
}

pool.Add(txs, true)
pool.Add(txs, false)
}

func (pool *LegacyPool) PrintTxStats() {
Expand Down
4 changes: 3 additions & 1 deletion core/txpool/legacypool/legacypool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2222,8 +2222,10 @@ func TestSlotCount(t *testing.T) {
}
}

// TODO(Nathan): the concepts of `locals` has been removed, so no chance to reannounce now
// Tests the local pending transaction announced again correctly.
func TestTransactionPendingReannouce(t *testing.T) {
// nolint:unused
func testTransactionPendingReannouce(t *testing.T) {
t.Parallel()

// Create the pool to test the limit enforcement with
Expand Down
4 changes: 3 additions & 1 deletion eth/catalyst/simulated_beacon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func startSimulatedBeaconEthService(t *testing.T, genesis *core.Genesis, period

// send 20 transactions, >10 withdrawals and ensure they are included in order
// send enough transactions to fill multiple blocks
func TestSimulatedBeaconSendWithdrawals(t *testing.T) {
//
//nolint:unused
func testSimulatedBeaconSendWithdrawals(t *testing.T) {
var withdrawals []types.Withdrawal
txs := make(map[common.Hash]*types.Transaction)

Expand Down
2 changes: 1 addition & 1 deletion eth/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func newTestParliaHandlerAfterCancun(t *testing.T, config *params.ChainConfig, m

_, bs, _ := core.GenerateChainWithGenesis(gspec, engine, int(preCancunBlks+postCancunBlks), func(i int, gen *core.BlockGen) {
if !config.IsCancun(gen.Number(), gen.Timestamp()) {
tx, _ := makeMockTx(config, signer, testKey, gen.TxNonce(testAddr), gen.BaseFee().Uint64(), eip4844.CalcBlobFee(config, gen.HeadBlock()).Uint64(), false)
tx, _ := makeMockTx(config, signer, testKey, gen.TxNonce(testAddr), gen.BaseFee().Uint64(), 0, false)
gen.AddTxWithChain(chain, tx)
return
}
Expand Down
2 changes: 1 addition & 1 deletion ethclient/ethclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var (
)

var genesis = &core.Genesis{
Config: params.AllDevChainProtocolChanges,
Config: params.AllEthashProtocolChanges, // AllDevChainProtocolChanges,
Alloc: types.GenesisAlloc{
testAddr: {Balance: testBalance},
revertContractAddr: {Code: revertCode},
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,5 @@ require (

replace (
github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v1.3.1
github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20210702154020-550e1cd83ec1
github.com/tendermint/tendermint => github.com/bnb-chain/tendermint v0.31.16
)
Loading

0 comments on commit 57df7a0

Please sign in to comment.