Skip to content

Commit

Permalink
change to sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Sep 12, 2023
1 parent c6a8571 commit cd01ed3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package types
import (
"bytes"
"container/heap"
"crypto/sha256"
"encoding/binary"
"errors"
"io"
Expand All @@ -32,7 +33,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
"github.com/google/uuid"
"golang.org/x/crypto/sha3"
)

var (
Expand Down Expand Up @@ -801,7 +801,7 @@ func (b *MevBundle) UniquePayload() []byte {
}

func (b *MevBundle) ComputeUUID() uuid.UUID {
return uuid.NewHash(sha3.NewLegacyKeccak256(), uuid.Nil, b.UniquePayload(), 5)
return uuid.NewHash(sha256.New(), uuid.Nil, b.UniquePayload(), 5)
}

func (b *MevBundle) RevertingHash(hash common.Hash) bool {
Expand Down
4 changes: 2 additions & 2 deletions flashbotsextra/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func TestBundleUUIDHash(t *testing.T) {
Hash: common.HexToHash("0x135a7f22459b2102d51de2d6704512a03e1e2d2059c34bcbb659f4ba65e9f92c"),
}

require.Equal(t, "82624e95-741e-5a60-9198-b2f7b2ed973f", b.ComputeUUID().String())
require.Equal(t, "5171315f-6ba4-52b2-866e-e2390d422d81", b.ComputeUUID().String())
})
t.Run("one revert", func(t *testing.T) {
b := types.MevBundle{
Expand All @@ -216,6 +216,6 @@ func TestBundleUUIDHash(t *testing.T) {
},
}

require.Equal(t, "19f6e9a2-04a1-5616-9bb3-5c9f81653e4f", b.ComputeUUID().String())
require.Equal(t, "49dada39-6db2-500e-ae59-6cc18b2c19e0", b.ComputeUUID().String())
})
}

0 comments on commit cd01ed3

Please sign in to comment.