Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merkeltree upstream #314

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/wealdtech/go-eth2-types/v2 v2.7.0
github.com/wealdtech/go-eth2-util v1.7.0
github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.3.0
github.com/wealdtech/go-merkletree v1.0.1-0.20190605192610-2bb163c2ea2a
github.com/wealdtech/go-merkletree v1.0.1-0.20230205101955-ec7a95ea11ca
github.com/web3-storage/go-w3s-client v0.0.7
golang.org/x/crypto v0.4.0
golang.org/x/sync v0.1.0
Expand Down Expand Up @@ -182,6 +182,4 @@ require (
nhooyr.io/websocket v1.8.7 // indirect
)

replace github.com/wealdtech/go-merkletree v1.0.1-0.20190605192610-2bb163c2ea2a => github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd

// replace github.com/rocket-pool/rocketpool-go => ../rocketpool-go
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,6 @@ github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE=
github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd h1:p9KuetSKB9nte9I/MkkiM3pwKFVQgqxxPTQ0y56Ff6s=
github.com/rocket-pool/go-merkletree v1.0.1-0.20220406020931-c262d9b976dd/go.mod h1:UE9fof8P7iESVtLn1K9CTSkNRYVFHZHlf96RKbU33kA=
github.com/rocket-pool/rocketpool-go v1.4.2 h1:Jp1X4hkaRthVu7YMXgip+n2K8tvLwPjlGEutpti658I=
github.com/rocket-pool/rocketpool-go v1.4.2/go.mod h1:+7kSXEvMUCEqstio3PBVTnaGoI2lSTwNUJ8/D4D91gM=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
Expand Down Expand Up @@ -1817,6 +1815,8 @@ github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.3.0 h1:3Kx2QvKU/4PP0
github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.3.0/go.mod h1:qqIU42c9sXcNYsiEjUQoOOWYZfZDL1zmyLtz3t+wN2s=
github.com/wealdtech/go-eth2-wallet-types/v2 v2.9.0 h1:XqWgsONVqsPvciuEXxM/QU4hYouBVk0+5/pGqDMGUHQ=
github.com/wealdtech/go-eth2-wallet-types/v2 v2.9.0/go.mod h1:7Ad2xp27vOQRQWQsIeHBdU/YiyEt6klBeh5gwnNnlwE=
github.com/wealdtech/go-merkletree v1.0.1-0.20230205101955-ec7a95ea11ca h1:oK35INPN4CiubFw7ZPQkbxm2AsSU6Tjeb9YhciZnvIM=
github.com/wealdtech/go-merkletree v1.0.1-0.20230205101955-ec7a95ea11ca/go.mod h1:bM9mDSjsti+gkjl8FjovMoUH3MPR5bwJ3+ucaYFY0Jk=
github.com/wealdtech/go-multicodec v1.4.0 h1:iq5PgxwssxnXGGPTIK1srvt6U5bJwIp7k6kBrudIWxg=
github.com/wealdtech/go-multicodec v1.4.0/go.mod h1:aedGMaTeYkIqi/KCPre1ho5rTb3hGpu/snBOS3GQLw4=
github.com/wealdtech/go-string2eth v1.1.0 h1:USJQmysUrBYYmZs7d45pMb90hRSyEwizP7lZaOZLDAw=
Expand Down
6 changes: 5 additions & 1 deletion shared/services/rewards/generator-impl-v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ func (r *treeGeneratorImpl_v1) generateMerkleTree() error {
}

// Generate the tree
tree, err := merkletree.NewUsing(totalData, keccak256.New(), false, true)
tree, err := merkletree.NewTree(
merkletree.WithData(totalData),
merkletree.WithHashType(keccak256.New()),
merkletree.WithSorted(true),
)
if err != nil {
return fmt.Errorf("error generating Merkle Tree: %w", err)
}
Expand Down
6 changes: 5 additions & 1 deletion shared/services/rewards/generator-impl-v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ func (r *treeGeneratorImpl_v2) generateMerkleTree() error {
}

// Generate the tree
tree, err := merkletree.NewUsing(totalData, keccak256.New(), false, true)
tree, err := merkletree.NewTree(
merkletree.WithData(totalData),
merkletree.WithHashType(keccak256.New()),
merkletree.WithSorted(true),
)
if err != nil {
return fmt.Errorf("error generating Merkle Tree: %w", err)
}
Expand Down
6 changes: 5 additions & 1 deletion shared/services/rewards/generator-impl-v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ func (r *treeGeneratorImpl_v3) generateMerkleTree() error {
}

// Generate the tree
tree, err := merkletree.NewUsing(totalData, keccak256.New(), false, true)
tree, err := merkletree.NewTree(
merkletree.WithData(totalData),
merkletree.WithHashType(keccak256.New()),
merkletree.WithSorted(true),
)
if err != nil {
return fmt.Errorf("error generating Merkle Tree: %w", err)
}
Expand Down
6 changes: 5 additions & 1 deletion shared/services/rewards/generator-impl-v4.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ func (r *treeGeneratorImpl_v4) generateMerkleTree() error {
}

// Generate the tree
tree, err := merkletree.NewUsing(totalData, keccak256.New(), false, true)
tree, err := merkletree.NewTree(
merkletree.WithData(totalData),
merkletree.WithHashType(keccak256.New()),
merkletree.WithSorted(true),
)
if err != nil {
return fmt.Errorf("error generating Merkle Tree: %w", err)
}
Expand Down