mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
eth/catalyst: drop flaky txpool subtest for TestCommitBlockV1
After the prior commit subtests advanced the chain, the txpool's
internal Reset() is asynchronous. On slower runners (observed on the
Windows amd64 CI image) GetPoolNonce returns a stale value before
Reset has processed the new head, the signed tx gets rejected as
nonce-too-low, and the committed block lands empty.
The from-mempool path is optional per spec ("MAY build from mempool")
and is already covered by the hive commit-block-z-from-mempool SpecOnly
fixture, so removing this unit-test variant doesn't lose coverage.
This commit is contained in:
parent
bcca4858b5
commit
75e4fe44c5
1 changed files with 0 additions and 23 deletions
|
|
@ -190,29 +190,6 @@ func TestCommitBlockV1(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
t.Run("commitBlockWithTransactionsFromTxPool", func(t *testing.T) {
|
||||
parent := ethservice.BlockChain().CurrentBlock()
|
||||
nonce, _ := ethservice.APIBackend.GetPoolNonce(ctx, testAddr)
|
||||
tx, _ := types.SignTx(types.NewTransaction(nonce, testAddr, big.NewInt(1), params.TxGas, big.NewInt(params.InitialBaseFee*2), nil), types.LatestSigner(ethservice.BlockChain().Config()), testKey)
|
||||
ethservice.TxPool().Add([]*types.Transaction{tx}, true)
|
||||
|
||||
hash, err := api.CommitBlockV1(ctx, nextAttrs(), nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("CommitBlockV1 failed: %v", err)
|
||||
}
|
||||
head := ethservice.BlockChain().CurrentBlock()
|
||||
if head.Hash() != hash {
|
||||
t.Errorf("head hash mismatch: got %x want %x", head.Hash(), hash)
|
||||
}
|
||||
if head.Number.Uint64() != parent.Number.Uint64()+1 {
|
||||
t.Errorf("head number mismatch: got %d want %d", head.Number.Uint64(), parent.Number.Uint64()+1)
|
||||
}
|
||||
block := ethservice.BlockChain().GetBlockByHash(hash)
|
||||
if len(block.Transactions()) != 1 {
|
||||
t.Fatalf("expected 1 transaction, got %d", len(block.Transactions()))
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("commitWithExtraData", func(t *testing.T) {
|
||||
extra := hexutil.Bytes([]byte("hello"))
|
||||
emptyTxs := []hexutil.Bytes{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue