Layr-Labs / eigenlayer-rewards-updater

Other
3 stars 4 forks source link

Generating merkle proofs as the rewards claimer #47

Open sourdzl opened 1 month ago

sourdzl commented 1 month ago

Hi,

I am trying to test rewards claiming on Holesky with a smart contract that has been set as the claimer/recipient for an LRT.

Am I correct that this repository is targeting the distributor of rewards, and not claimers? It appears that we need to have a file containing the entire rewards distribution in order to use this, please correct me if I'm wrong - I didn't see a fully specified example command to run, and stopped trying after I got

$ ./bin/eigenlayer-rewards-updater updater \
    --debug true \
    --environment "dev" \
    --network "devnet"
Error loading config file: Config File "config" Not Found in "[/Users/danlee/.eigenlayer-rewards-updater /etc/eigenlayer-rewards-updater /Users/danlee/code/eigenlayer-rewards-updater]"
seanmcgary commented 1 month ago

@sourdzl you're in the right place. This particular repo is a CLI tool for not only generating the root that we post that you'll claim against, but it also has a CLI command for claiming (though it's a bit limited in signing functionality right now...).

Here's an example of the input/output for testnet:

EIGENLAYER_ENABLE_STATSD=false \
EIGENLAYER_ENABLE_TRACING=false \
./bin/eigenlayer-rewards-updater claim \
    --environment "testnet" \
    --network "holesky" \
    --rpc-url "https://ethereum-holesky-rpc.publicnode.com" \
    --proof-store-base-url "https://eigenlabs-rewards-preprod-holesky.s3.amazonaws.com" \
    --rewards-coordinator-address "0xAcc1fb458a1317E886dB376Fc8141540537E68fE" \
    --earner-address "<the address you are claiming for>" \
    --tokens "<token 1 address to claim>" \
    --tokens "<token 2 address to claim, etc>" \
    --claim-timestamp "latest"

Output

{
  "Root": "0xa38767bc05b3842537d6cb9bbc0172a8354baef6cf0a981d6d1ea9a9cde3d54d",
  "RootIndex": 36,
  "EarnerIndex": 8496,
  "EarnerTreeProof": "0xcf6519c9d645ab3da1f60467a7fc5cb8e5ed774841e2ebe26242dffe542dc7cee8feee49c567526c57528c97d40920b2506f4650791d64f0b2f2fe93963b37a6bef277fbe0984999aa6f35e63a7f1a552de31828754b80efb7d0128d6c13549a63e2191744f0aee938ee91e9d31afd13bcb40c40acb8b28cb212cbfc33eb2a31aa4b4b2e8585d04af3e44f3cf6e807ed7f727ddb75f9758db8e2c05148452d861b8e66a954a69b538a65025d0bf0969b8ffc2943dd6bc057f8710b4134ea1b89122c0bbe9a9a5e67fe27c5aca375fcb1db4e6c513e2241815692626f1a375880c2ea12eea62a0744abded521bc5afe17867ded0277e857719c40678c0ab32f7da5e632a96b60f021138e27c19739b7bc22376c70721646ffdc7dee5d1ffb700e2bffd9b267ebab342440b1e1aee4cae2a44d390590e2b74d0360f5a92c43495b2fdd85e8709d456445c9721ea703056e025edf9a71a65bbd3273fe08283360d56f3a7cc8e0762ff842b635613b148dd5072a59b24c4e3e8a9a76d852a2bce655a8eccf42f0267ea967a3dc825f8fe722629eafc649aba43250b0dac4fac975d4db3a7c48bd2f5fc9c8d643bb72e39ea0b6eee4df6d9eec2e092863d330a337f2be91747cbd2cf4eff7e7ca1b8fcb173af15bbdd1c1ca54615dff9121b79eac71ea5ef7be7d0685220ed184f8fb7b5c5a3a9f70d9dd4e81101e1694c57979b534a82d8aa0e2356f296612951bfe4302f99dc8e8fbce8aba486ff286ccae344b2b",
  "EarnerLeaf": {
    "Earner": "0x111116fe4f8c2f83e3eb2318f090557b7cd0bf76",
    "EarnerTokenRoot": "0xac0bcb053cf6f85e162bcc30e14954889d3b7a787156caf0b2be99af4c658841"
  },
  "LeafIndices": [
    0
  ],
  "TokenTreeProofs": [
    "0x"
  ],
  "TokenLeaves": [
    {
      "Token": "0xdeeeee2b48c121e6728ed95c860e296177849932",
      "CumulativeEarnings": 109613863461111005000000
    }
  ],
  "TokenTreeProofsNum": 1,
  "TokenLeavesNum": 1
}

The CLI does have the ability to create and submit the claim transaction, however it only works by providing a private key to the CLI directly. To do that, you'd add the flags:

--private-key "...your key..." \
--submit-claim true
sourdzl commented 1 month ago

thank you for the quick response!

Is there permissioning around the data? I'm getting the following output

$ EIGENLAYER_ENABLE_STATSD=false \                                                                                                         130
EIGENLAYER_ENABLE_TRACING=false \
./bin/eigenlayer-rewards-updater claim \
        --environment "testnet" \
        --network "holesky" \
        --rpc-url "https://ethereum-holesky-rpc.publicnode.com" \
        --proof-store-base-url "https://eigenlabs-rewards-preprod-holesky.s3.amazonaws.com" \
        --rewards-coordinator-address "0xAcc1fb458a1317E886dB376Fc8141540537E68fE" \
        --earner-address "<the address you are claiming for>" \
        --tokens "<token 1 address to claim>" \
        --tokens "<token 2 address to claim, etc>" \
        --claim-timestamp "latest"
Error loading config file: Config File "config" Not Found in "[/Users/danlee/.eigenlayer-rewards-updater /etc/eigenlayer-rewards-updater /Users/danlee/code/eigenlayer-rewards-updater]"
{"level":"info","ts":1721319766.481225,"caller":"cmd/claim.go:65","msg":"Generating claim based on latest submitted reward"}
{"level":"error","ts":1721319767.35174,"caller":"httpProofDataFetcher/fetcher.go:176","msg":"Received error code '403'","url":"https://eigenlabs-rewards-preprod-holesky.s3.amazonaws.com/testnet/holesky/2024-07-17/claim-amounts.json","body":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>QNNGP679NR7Y8KT1</RequestId><HostId>CgJWeDbS1GEvC60OjEZ8LV8FnLkfFl0JKffTqJxth6I8zYTExlZx4ptBZ7zJSWNB</HostId></Error>","stacktrace":"github.com/Layr-Labs/eigenlayer-rewards-updater/pkg/proofDataFetcher/httpProofDataFetcher.(*HttpProofDataFetcher).handleRequest\n\t/Users/danlee/code/eigenlayer-rewards-updater/pkg/proofDataFetcher/httpProofDataFetcher/fetcher.go:176\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/pkg/proofDataFetcher/httpProofDataFetcher.(*HttpProofDataFetcher).FetchClaimAmountsForDate\n\t/Users/danlee/code/eigenlayer-rewards-updater/pkg/proofDataFetcher/httpProofDataFetcher/fetcher.go:49\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.runClaimgen\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/claim.go:90\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.init.func1\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/claim.go:154\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.Execute\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/root.go:23\nmain.main\n\t/Users/danlee/code/eigenlayer-rewards-updater/main.go:9\nruntime.main\n\t/opt/homebrew/Cellar/go/1.22.3/libexec/src/runtime/proc.go:271"}
{"level":"error","ts":1721319767.353865,"caller":"cmd/claim.go:92","msg":"Failed to fetch proof data%!(EXTRA zapcore.Field={error 26 0  Received error code '403'})","stacktrace":"github.com/Layr-Labs/eigenlayer-rewards-updater/cmd.runClaimgen\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/claim.go:92\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.init.func1\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/claim.go:154\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.Execute\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/root.go:23\nmain.main\n\t/Users/danlee/code/eigenlayer-rewards-updater/main.go:9\nruntime.main\n\t/opt/homebrew/Cellar/go/1.22.3/libexec/src/runtime/proc.go:271"}
{"level":"error","ts":1721319767.354608,"caller":"cmd/claim.go:157","msg":"Received error code '403'","stacktrace":"github.com/Layr-Labs/eigenlayer-rewards-updater/cmd.init.func1\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/claim.go:157\ngithub.com/spf13/cobra.(*Command).execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/Users/danlee/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\ngithub.com/Layr-Labs/eigenlayer-rewards-updater/cmd.Execute\n\t/Users/danlee/code/eigenlayer-rewards-updater/cmd/root.go:23\nmain.main\n\t/Users/danlee/code/eigenlayer-rewards-updater/main.go:9\nruntime.main\n\t/opt/homebrew/Cellar/go/1.22.3/libexec/src/runtime/proc.go:271"}
null