Sitelet https://github.com/Fantom-foundation/go-opera/commit/b0d2825f5750571db21e99941e9cbbc2e58d7fa0
Skip to content

Commit b0d2825

Browse files
committed
Merge pull request #109 from rus-alex/fix/block-txs-store
Fix of block txs store
2 parents 10ca669 + 2b408d6 commit b0d2825

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

‎gossip/c_block_callbacks.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ func consensusCallbackBeginBlockFn(
202202
}
203203

204204
externalReceipts := evmProcessor.Execute(txs, false)
205-
evmBlock, skippedTxs, allReceipts := evmProcessor.Finalize()
206205

206+
evmBlock, skippedTxs, allReceipts := evmProcessor.Finalize()
207207
block.SkippedTxs = skippedTxs
208208
block.Root = hash.Hash(evmBlock.Root)
209209
block.GasUsed = evmBlock.GasUsed

‎inter/block.go‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Block struct {
1010
Time Timestamp
1111
Atropos hash.Event
1212
Events hash.Events
13-
Txs []common.Hash
13+
Txs []common.Hash // non events txs (genesis)
1414
InternalTxs []common.Hash
1515
SkippedTxs []uint32 // indexes of skipped txs, starting from first tx of first event, ending with last tx of last event
1616
GasUsed uint64
@@ -21,25 +21,6 @@ func (b *Block) EstimateSize() int {
2121
return (len(b.Events)+len(b.InternalTxs)+len(b.Txs)+1+1)*32 + len(b.SkippedTxs)*4 + 8 + 8
2222
}
2323

24-
func (b *Block) NotSkippedTxs() []common.Hash {
25-
txs := append(b.InternalTxs, b.Txs...)
26-
27-
if len(b.SkippedTxs) == 0 {
28-
// short circuit if nothing to skip
29-
return txs
30-
}
31-
skipCount := 0
32-
res := make([]common.Hash, 0, len(txs))
33-
for i, tx := range txs {
34-
if skipCount < len(b.SkippedTxs) && b.SkippedTxs[skipCount] == uint32(i) {
35-
skipCount++
36-
} else {
37-
res = append(res, tx)
38-
}
39-
}
40-
return res
41-
}
42-
4324
func FilterSkippedTxs(txs types.Transactions, skippedTxs []uint32) types.Transactions {
4425
if len(skippedTxs) == 0 {
4526
// short circuit if nothing to skip

0 commit comments

Comments
 (0)