dappnode / mev-sp-oracle

3 stars 1 forks source link

mev-sp-oracle

Smooth is made of:

Description

This software allows anyone to reconstruct the same state as the one available in smooth.dappnode.io, which is just provided for convenience. Using a consensus + execution client and this oracle, you will be able to calculate the rewards of all subscribed validators, generate your own Merkle proofs, and use them to claim your rewards, without relaying in any 3rd party hosted service. Technical details of the implementation can be found in the specification.

Build from source

go build
./mev-sp-oracle --help

Docker images

docker pull dappnode/mev-sp-oracle:1.0.8

Roles

The oracle can run in two modes:

Running Your Smooth Oracle

You need a consensus + execution client + point the oracle to Smooth mainnet contract0xAdFb8D27671F14f297eE94135e266aAFf8752e35. Note that the consensus client shall be running in archival mode, slots-per-restore-point=512 is enough. It will take some time to sync.

./mev-sp-oracle \
--consensus-endpoint="http://127.0.0.1:3500" \
--execution-endpoint="http://127.0.0.1:8545" \
--pool-address=0xAdFb8D27671F14f297eE94135e266aAFf8752e35 \
--relayers-endpoints=https://NOTNEEDED \
--log-level=debug \
--dry-run

The oracle exposes a REST API documented here that you can use to monitor its health, check your rewards, and calculate your Merkle proofs to claim your rewards. Note that this is optional and smooth.dappnode.io is provided for convenience, but not needed, since a local hosted oracle can provide the same data.

You can check the sync status. The oracle_sync_distance_slots indicates how far the oracle is behind the latest finalized slot, where 0 means totally in sync.

curl localhost:7300/status

You can also get the Merkle proofs of your withdrawal address as follows. They can be submitted directly into the contract using the claimRewards call.

curl localhost:7300/onchain/proof/0X_YOUR_WITHDRAWAL_ADDRESS

If someone you trust runs an oracle you can use the --checkpoint-sync-url=http://ip_address:7300/state flag. This will get the state from that oracle, and continue syncing from there. Useful to avoid having to sync everything, but requires trust in the endpoint provider.

Tests

Note that some files used for testing are bigger than what Github allows, so you may have to fetch it with git lfs.

git lfs checkout
go test ./... -v

License

GNU General Public License v3.0

Legal Disclaimer

Terms Of Service