Closed sideninja closed 3 months ago
[!CAUTION]
Review failed
The pull request is closed.
The recent updates to the block handling in models/block.go
introduce a more flexible decoding mechanism for block data. By replacing the single version structure with multiple versioned structures, the system now supports backward compatibility with older formats. The newly implemented decodeBlockBreakingChanges
function enhances the decoding process, allowing for robust handling of diverse block versions while simplifying the interaction with block data.
Files | Change Summary |
---|---|
models/block.go |
Significant refactor of block data handling; replaced single version with multiple versions (blockV0 to blockV6 ). Added decodeBlockBreakingChanges function for flexible decoding. Modified pastBlockHash to accept generic types. Removed blockV0360 struct. |
sequenceDiagram
participant User
participant BlockManager
participant BlockDecoder
participant LegacyBlock
User->>BlockManager: Request Block Data
BlockManager->>BlockDecoder: NewBlockFromBytes(data)
BlockDecoder-->>BlockDecoder: Attempt decode with blockV0 to blockV6
BlockDecoder-->>LegacyBlock: Decode Successful
BlockDecoder-->>BlockManager: Return Block
BlockManager-->>User: Provide Block Data
🐇 "In the meadow, blocks do dance,
With versions new, they take a chance.
From bytes to forms, they leap and twirl,
A rabbit's joy in a data swirl!
Hopping through history, past and present,
These changes make our code quite pleasant!" 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
We must use past block decoder, the code was moved from flow-go since we now have to still preserve transaction hashes which were removed in flow-go.
For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes