mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
core/rawdb: restore TD freezer table for backward compatibility
This commit is contained in:
parent
3b27580cc7
commit
f2320d832c
2 changed files with 16 additions and 4 deletions
|
|
@ -726,6 +726,14 @@ func writeAncientBlock(op ethdb.AncientWriteOp, block *types.Block, header *type
|
||||||
if err := op.Append(ChainFreezerReceiptTable, num, receipts); err != nil {
|
if err := op.Append(ChainFreezerReceiptTable, num, receipts); err != nil {
|
||||||
return fmt.Errorf("can't append block %d receipts: %v", num, err)
|
return fmt.Errorf("can't append block %d receipts: %v", num, err)
|
||||||
}
|
}
|
||||||
|
// TODO (rjl493456442) TD has been deprecated and write garbage data for
|
||||||
|
// backward compatibility. See https://github.com/ethereum/go-ethereum/pull/30744/.
|
||||||
|
//
|
||||||
|
// The TD freezer table is retained for backward compatibility within this
|
||||||
|
// major version (1.14.x) and will be discarded in the next major version.
|
||||||
|
if err := op.Append(ChainFreezerDifficultyTable, num, big.NewInt(0)); err != nil {
|
||||||
|
return fmt.Errorf("can't append block %d total difficulty: %v", num, err)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ const (
|
||||||
|
|
||||||
// ChainFreezerReceiptTable indicates the name of the freezer receipts table.
|
// ChainFreezerReceiptTable indicates the name of the freezer receipts table.
|
||||||
ChainFreezerReceiptTable = "receipts"
|
ChainFreezerReceiptTable = "receipts"
|
||||||
|
|
||||||
|
// ChainFreezerDifficultyTable indicates the name of the freezer total difficulty table.
|
||||||
|
ChainFreezerDifficultyTable = "diffs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// chainFreezerNoSnappy configures whether compression is disabled for the ancient-tables.
|
// chainFreezerNoSnappy configures whether compression is disabled for the ancient-tables.
|
||||||
|
|
@ -44,6 +47,7 @@ var chainFreezerNoSnappy = map[string]bool{
|
||||||
ChainFreezerHashTable: true,
|
ChainFreezerHashTable: true,
|
||||||
ChainFreezerBodiesTable: false,
|
ChainFreezerBodiesTable: false,
|
||||||
ChainFreezerReceiptTable: false,
|
ChainFreezerReceiptTable: false,
|
||||||
|
ChainFreezerDifficultyTable: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue