Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit aaaad62

Browse files
committed
Remove setPending from accept
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
1 parent d216bb8 commit aaaad62

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

plugin/evm/vm_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ func TestBuildBlockWithInsufficientCapacity(t *testing.T) {
14351435
require.NoError(err)
14361436

14371437
require.NoError(blk2.Accept(ctx))
1438+
require.NoError(vm.SetPreference(t.Context(), blk2.ID()))
14381439

14391440
// Attempt to build a block consuming more than the current gas capacity
14401441
_, err = vmtest.IssueTxsAndBuild([]*types.Transaction{txs[1]}, vm)
@@ -1453,6 +1454,7 @@ func TestBuildBlockWithInsufficientCapacity(t *testing.T) {
14531454

14541455
require.NoError(blk3.Verify(ctx))
14551456
require.NoError(blk3.Accept(ctx))
1457+
vm.SetPreference(t.Context(), blk3.ID())
14561458
}
14571459

14581460
func TestBuildBlockLargeTxStarvation(t *testing.T) {
@@ -1503,6 +1505,7 @@ func TestBuildBlockLargeTxStarvation(t *testing.T) {
15031505
require.NoError(err)
15041506

15051507
require.NoError(blk2.Accept(ctx))
1508+
vm.SetPreference(t.Context(), blk2.ID())
15061509

15071510
// Add a second transaction trying to consume the max guaranteed gas capacity at a higher gas price
15081511
errs := vm.txPool.AddRemotesSync([]*types.Transaction{maxSizeTxs[1]})
@@ -1708,6 +1711,7 @@ func TestWaitForEvent(t *testing.T) {
17081711
require.NoError(t, err)
17091712
err = blk2.Accept(t.Context())
17101713
require.NoError(t, err)
1714+
vm.SetPreference(t.Context(), blk2.ID())
17111715
wg.Wait()
17121716
},
17131717
},

plugin/evm/wrapped_block.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ func (b *wrappedBlock) Accept(context.Context) error {
104104
"height", b.Height(),
105105
)
106106

107-
vm.setPendingBlock(b.ethBlock.Hash())
108-
109107
// Call Accept for relevant precompile logs. Note we do this prior to
110108
// calling Accept on the blockChain so any side effects (eg warp signatures)
111109
// take place before the accepted log is emitted to subscribers.

0 commit comments

Comments
 (0)