Skip to content

Commit

Permalink
fix oldstyle bitflip
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield authored and hkalodner committed Jul 22, 2022
1 parent f879b69 commit 5e0ee73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arbstate/inbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ func RecoverPayloadFromDasBatch(

if preimages != nil {
if version == 0 {
treeLeaf := dastree.FlatHashToTreeLeaf(dataHash)
preimages[dataHash] = payload
preimages[dastree.FlatHashToTreeHash(dataHash)] = dastree.FlatHashToTreeLeaf(dataHash)
preimages[crypto.Keccak256Hash(treeLeaf)] = treeLeaf
} else {
dastree.RecordHash(recordPreimage, payload)
}
Expand Down
2 changes: 1 addition & 1 deletion das/dastree/dastree.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func HashBytes(preimage ...[]byte) []byte {
func FlatHashToTreeHash(flat bytes32) bytes32 {
// Forms a degenerate dastree that's just a single leaf
// note: the inner preimage may be larger than the 64 kB standard
return arbmath.FlipBit(crypto.Keccak256Hash(append([]byte{LeafByte}, flat[:]...)), 0)
return arbmath.FlipBit(crypto.Keccak256Hash(FlatHashToTreeLeaf(flat)), 0)
}

func FlatHashToTreeLeaf(flat bytes32) []byte {
Expand Down

0 comments on commit 5e0ee73

Please sign in to comment.