-
Notifications
You must be signed in to change notification settings - Fork 0
SSV Oracle & Cluster Updater #3
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
Merged
Merged
Changes from 107 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
a5bd8df
initial commit
olegshmuelov 11b7a47
improve error handling and address code review issues
olegshmuelov 1936909
decouple updater from timing calculation
olegshmuelov 2cbf35f
migrate to zap structured logging
olegshmuelov afe61fc
deduplicate syncOnce by delegating to SyncToBlock
olegshmuelov ad3185a
simplify schema for forward-only processing
olegshmuelov 533ab69
refactor: integrate updater into oracle with --updater flag
olegshmuelov 1329a0f
remove mock mode and consolidate to single SSV Network contract
olegshmuelov 641583a
migrate beacon client to go-eth2-client
olegshmuelov d2c1a95
refactor storage interfaces and improve graceful shutdown
olegshmuelov ad9dc92
use typed map keys instead of hex strings
olegshmuelov b8e1f42
rename TimingPhase to CommitPhase
olegshmuelov de63a37
simplify logging by removing passed logger parameters
olegshmuelov c5d81f5
simplify merkle package: remove unused code and fix tests
olegshmuelov 6294517
improve error handling and logging
olegshmuelov db006b5
simplify Makefile
olegshmuelov 1355206
update docs with new Makefile commands
olegshmuelov 0908780
add wallet abstraction and commit status tracking
olegshmuelov fcfcffc
add txmanager package for transaction lifecycle management
olegshmuelov b6049dd
add ClusterBalanceUpdated event and refactor parsers to use Cluster type
olegshmuelov 343116d
docker: production-ready image with OCI labels and build improvements
olegshmuelov bc2e9a9
use composite interface and consolidate constants
olegshmuelov d5e2a50
remove redundant comments and add missing doc comments
olegshmuelov c46ad0b
improve code quality and observability
olegshmuelov a9baf8a
extract cluster event helpers to reduce duplication
olegshmuelov db34c50
review adjustments
olegshmuelov e15c0d3
rename timing to phase
olegshmuelov c4650fa
improve test quality
olegshmuelov 3a3c06b
remove unused test mocks
olegshmuelov 8d70a10
improve oracle
olegshmuelov 2410560
exclude unknown events from sync count
olegshmuelov d48e29d
cleanup and optimize syncer/parser
olegshmuelov 4a3b7cd
classify tx errors to avoid retrying permanent failures
olegshmuelov a9b492a
bump receiptPollInterval to 4s
olegshmuelov 8be2f73
extract version from git in Dockerfile automatically
olegshmuelov 846c0b6
add GitHub Actions CI/CD workflows
olegshmuelov af6bb62
cosmetic changes
olegshmuelov f5abb8f
improve log
olegshmuelov 4ace249
use golangci-lint v2.7.2 for Go 1.25 support
olegshmuelov 136c1cc
upgrade to Go 1.25.5 for security patches
olegshmuelov c405e58
use golangci-lint-action v7 for v2.x support
olegshmuelov 7d9623f
update ClusterBalanceUpdated event to new ABI signature
olegshmuelov 6243bcc
address lint warnings
olegshmuelov 7ce2bf5
use build args for Docker version injection
olegshmuelov bc11d7e
remove unused release workflow
olegshmuelov 0f90cef
delete unused doc
olegshmuelov 4991e3a
pre-audit review
olegshmuelov 0725cf6
reorganize codebase following Go conventions
olegshmuelov 6585ec0
improve event handling: fix ABI, add tests, support ClusterMigratedToETH
olegshmuelov 21d75cc
apply 32 ETH floor for low/missing validator balances
olegshmuelov 79521ae
refactor: complete SQLite migration from PostgreSQL
olegshmuelov 090d3d0
chore: add SQLite database to gitignore
olegshmuelov 3659bf3
fix: address linter errors in storage tests
olegshmuelov 3e21185
modernize Go code and add db_path default
olegshmuelov 47b6d75
fix: align ClusterBalanceUpdated event with new ABI
olegshmuelov fc8874e
fix: simplify balance floor logic to 32 ETH minimum
olegshmuelov bef0c75
use balanceFloorGwei constant instead of magic number
olegshmuelov 4e1e14a
go fmt ./..
olegshmuelov f3d8764
chore: log db_path on startup
olegshmuelov d9cb034
feat: sync clusters to head before updating balances
olegshmuelov cea9596
simplify oracle architecture and improve context handling
olegshmuelov b64fc15
feat: add SSVNetworkViews integration with lazy head sync
olegshmuelov b0a47ea
minor optimizations
olegshmuelov 2eea0ef
feat: replace polling with SSE for beacon finalization
olegshmuelov 9235da5
beacon finalization semantics and add retry support
olegshmuelov f97fb20
refactor: config and startup improvements
olegshmuelov a092366
refactor(oracle): replace lastCommitted with nextTarget
olegshmuelov 335241c
fix(oracle): prevent stale data commits when missing target
olegshmuelov 39b12ea
address PR review feedback part1
olegshmuelov f41639c
refactor: restructure packages for better separation of concerns
olegshmuelov 98a1f02
address PR review feedback part2
olegshmuelov 95080c7
add retry for finalized checkpoint block fetch
olegshmuelov 0294add
log duplicate round_id in InsertPendingCommit
olegshmuelov bd2f156
refactor(txmanager): improve error classification and handling
olegshmuelov 787e884
fix(beacon): query validator balances by state root
olegshmuelov 59fe37c
simplify stale cluster detection and consistent error decoding
olegshmuelov e9a5720
address PR review feedback part3
olegshmuelov 27e1f97
align with updated ABIs and simplify updater error handling
olegshmuelov 6122840
refactor(merkle): use OpenZeppelin StandardMerkleTree format
olegshmuelov 1f58c1b
simplify merkle naming
olegshmuelov 67ad7a3
chore(ci): avoid duplicate runs on PRs
olegshmuelov 544dcff
fix(syncer): parse ClusterBalanceUpdated and improve error logging
olegshmuelov 8777272
align with updated ABIs and deduplicate RootCommitted events
olegshmuelov a37c44f
refactor: use short-form error messages
olegshmuelov fccf2bf
refactor(logger): use config file for log level
olegshmuelov 667740c
fix(updater): retry commit lookup to handle multi-oracle race condition
olegshmuelov 0b0c75f
simplify retry logic by removing Permanent errors
olegshmuelov 4fa2102
chore: codebase cleanup and improvements
olegshmuelov 3ba2c7d
chore: codebase cleanup and improvements
olegshmuelov 3494466
Update README.md
olegshmuelov 0222743
fix(beacon): use finalized state for validator balance queries
olegshmuelov 0781c90
skip retries for non-retriable HTTP errors
olegshmuelov d18efff
improve commit loop logging consistency
olegshmuelov f8d9724
feat(api): add HTTP API server with merkle tree visualization UI
olegshmuelov e71695f
chore: update docs and add balance change logging
olegshmuelov b8bd62d
feat(sync): sync optimizations
olegshmuelov 286e027
refactor(logging): apply outcome-based logging pattern
olegshmuelov 0880815
feat(beacon): query balances by state root instead of finalized alias
olegshmuelov d61c11b
refactor(txmanager): improve gas handling and retry semantics
olegshmuelov b00c06a
fix(txmanager): abort on base-fee cap
olegshmuelov b6c7726
feat(oracle): skip commit when root already confirmed on-chain
olegshmuelov 20ebc74
add cluster_id to contract_events, stop deleting empty clusters
olegshmuelov 6639980
ui: improve cluster selection panel transitions
olegshmuelov 60145d2
fix(logging): add units to duration fields in log output
olegshmuelov 135fccb
fix(beacon): improve WaitForStateReady retry logic for transient errors
olegshmuelov d16b0ef
fix(beacon): use finalized keyword instead of state root for non-arch…
olegshmuelov 3b1accf
address PR review feedback
olegshmuelov a2cfcf3
chore: rename module to github.com/ssvlabs/ssv-oracle
olegshmuelov 36b1bc3
fix: address PR review feedback [part2]
olegshmuelov 2c35ae1
test(execution): add unit tests for error categorization and log grou…
olegshmuelov 4f4b273
refactor(eth): make WithRetry generic with isRetriable callback
olegshmuelov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,45 @@ | ||
| # ------------------------------------------------------- | ||
| # 1. Git metadata and version-control artifacts | ||
| # ------------------------------------------------------- | ||
| .git | ||
| # Binaries | ||
| ssv-oracle | ||
| *.exe | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
|
|
||
| # Test files | ||
| *_test.go | ||
| testdata/ | ||
| coverage.* | ||
|
|
||
| # Documentation | ||
| *.md | ||
| !README.md | ||
|
|
||
| # Git | ||
| .git/ | ||
| .gitignore | ||
| .gitattributes | ||
| .github | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 2. Local development files & folders | ||
| # ------------------------------------------------------- | ||
| node_modules | ||
| npm-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
|
|
||
| __pycache__/ | ||
| *.py[cod] | ||
| *.pyo | ||
| *.pyd | ||
| *.egg-info/ | ||
|
|
||
| vendor/ | ||
| dist/ | ||
| target/ | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 3. Environment & credential files | ||
| # ------------------------------------------------------- | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 4. Editor and OS-specific files | ||
| # ------------------------------------------------------- | ||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 5. Dockerfiles and Docker-related artifacts (optional) | ||
| # ------------------------------------------------------- | ||
| # CI/CD | ||
| .github/ | ||
|
|
||
| # Docker | ||
| Dockerfile | ||
| .dockerignore | ||
| Dockerfile* | ||
| docker-compose*.yaml | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 6. Logs, caches, and coverage outputs | ||
| # ------------------------------------------------------- | ||
| logs/ | ||
| *.log | ||
| coverage/ | ||
| *.lcov | ||
| .cache/ | ||
| # Config (may contain secrets) | ||
| .env* | ||
| config.yaml | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 7. Testing artifacts (optional) | ||
| # ------------------------------------------------------- | ||
| test-results/ | ||
| pytest-report.html | ||
| *.spec.ts | ||
| *.test.js | ||
| *.test.ts | ||
| # AI assistant | ||
| .claude/ | ||
| CLAUDE.md | ||
|
|
||
| # ------------------------------------------------------- | ||
| # 8. Miscellaneous (customize as needed) | ||
| # ------------------------------------------------------- | ||
| *.local | ||
| *.bak | ||
| *.tmp | ||
| *.swp | ||
| # Misc | ||
| .DS_Store | ||
| *.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SSV Oracle Environment Variables | ||
| # Copy this to .env and fill in your values: | ||
| # cp .env.example .env | ||
|
|
||
| # Private key for signing transactions (with or without 0x prefix) | ||
| # WARNING: For development/testing only. For production, use keystore in config.yaml. | ||
| # Generate a test key with: cast wallet new | ||
| # PRIVATE_KEY=your_private_key_here | ||
|
|
||
| # Keystore password (for wallet type: keystore) | ||
| # KEYSTORE_PASSWORD=your_keystore_password | ||
|
|
||
| # DEV: Set to "true" for development mode (colored console output, debug level by default) | ||
| # DEV=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, stage] | ||
| pull_request: | ||
|
|
||
| env: | ||
| GO_VERSION: "1.25.5" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
|
|
||
| - name: Build | ||
| run: go build ./... | ||
|
|
||
| - name: Test | ||
| run: go test ./... | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
|
|
||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v7 | ||
| with: | ||
| version: v2.7.2 | ||
|
|
||
| docker: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # Full history for git describe | ||
|
|
||
| - name: Build Docker image | ||
| run: | | ||
| docker build \ | ||
| --build-arg VERSION=$(git describe --tags --always --dirty) \ | ||
| --build-arg GIT_COMMIT=$(git rev-parse --short HEAD) \ | ||
| -t ssv-oracle:test . | ||
|
|
||
| security: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
|
|
||
| - name: Install govulncheck | ||
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
|
||
| - name: Run govulncheck | ||
| run: govulncheck ./... | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,186 +1,19 @@ | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 1. Operating System Files | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # macOS | ||
| .DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
|
|
||
| # Linux | ||
| *~ | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 2. Version Control and Git Metadata | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # If someone accidentally commits a sensitive file, it's still in history- | ||
| # but ignoring it helps stop new copies from getting added. | ||
| .gitattributes | ||
| /.git/ # Don't include your .git directory as part of a submodule/context | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 3. Editor, IDE, and Workspace Settings | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # VSCode | ||
| .vscode/ | ||
| .vscode/* | ||
|
|
||
| # IntelliJ IDEA / WebStorm / PhpStorm / etc. | ||
| .idea/ | ||
| *.iml | ||
|
|
||
| # Eclipse | ||
| .project | ||
| .classpath | ||
| .settings/ | ||
|
|
||
| # Sublime Text | ||
| *.sublime-workspace | ||
| *.sublime-project | ||
| # Binaries | ||
| ssv-oracle | ||
|
|
||
| # Vim / Emacs / Nano swap files | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
| # Database | ||
| data/ | ||
|
|
||
| # JetBrains Rider | ||
| # IDE | ||
| .idea/ | ||
| *.sln.iml | ||
|
|
||
| # Miscellaneous editors | ||
| *.kate-swp | ||
| *.kate-swp.* | ||
| *.komodoproject | ||
| *.komodotoolbar | ||
| *.kdev4 | ||
| *.kdev4.* | ||
| # ... | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 4. Language-Agnostic Build Artifacts | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # Logs | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| /logs | ||
| *.log | ||
| *.log.* | ||
|
|
||
| # Dependency directories (if you want to rebuild inside the container or CI) | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Coverage reports | ||
| coverage/ | ||
| *.lcov | ||
| *.lcov.* | ||
| *.clover | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
| *.tmp | ||
| *.swp | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Compiled Python artifacts | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # Compiled JavaScript (bundles, minified, maps) | ||
| *.min.js | ||
| *.map | ||
|
|
||
|
|
||
|
|
||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 5. Language-Specific Temporary Files | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # Python | ||
| *.egg-info/ | ||
| *.egg | ||
| *.whl | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
| dist/ | ||
| build/ | ||
| .eggs/ | ||
|
|
||
| /.env | ||
| .venv/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # Node.js / JavaScript | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| /node_modules/ | ||
| # If you are using Yarn Plug'n'Play | ||
| .pnp.cjs | ||
| .pnp.loader.mjs | ||
|
|
||
| # TypeScript | ||
| *.tsbuildinfo | ||
|
|
||
| # Go | ||
| /bin/ | ||
| /vendor/ | ||
| /*.exe | ||
|
|
||
| .vscode/ | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 6. Configuration and Secret Files | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # Environment variables | ||
| # Environment files | ||
| .env | ||
| .env.*.local | ||
| .env.local | ||
| config.yaml | ||
|
|
||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # 10. Miscellaneous | ||
| # ───────────────────────────────────────────────────────────────────────── | ||
| # Backup files | ||
| *.bak | ||
| *.old | ||
| *.orig | ||
|
|
||
| # Coverage | ||
| coverage/ | ||
| *.lcov | ||
|
|
||
| # Database files | ||
| *.sqlite | ||
| *.sqlite3 | ||
|
|
||
|
|
||
| # Archives | ||
| *.zip | ||
| *.tar.gz | ||
| *.rar | ||
|
|
||
|
|
||
| # Fonts | ||
| *.eot | ||
| *.otf | ||
| *.ttf | ||
| *.woff | ||
| *.woff2 | ||
|
|
||
| # Executable packages | ||
| *.AppImage | ||
| *.deb | ||
| *.rpm | ||
| # OS | ||
| .DS_Store | ||
|
|
||
| # Editor temp files | ||
| ~$* | ||
| # Claude Code | ||
| .claude/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.