-
Notifications
You must be signed in to change notification settings - Fork 58
Retry mechanism for verification in multiple explorers #487
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
base: master
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, I left some comments and suggestions.
| """ | ||
| Etherscan block explorer verifier implementation. | ||
| """ | ||
| import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this is unused
| """ | ||
| import sys | ||
| import json | ||
| import time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems unused
scripts/verification/test_retry.py
Outdated
| import random | ||
| import unittest | ||
| from unittest.mock import patch, MagicMock | ||
| from typing import Tuple, Callable | ||
|
|
||
| from retry import retry_with_backoff, DEFAULT_MAX_RETRIES, DEFAULT_BASE_DELAY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random, MagicMock, Tuple, Callable, DEFAULT_MAX_RETRIES e DEFAULT_BASE_DELAY all seem unused
| data['libraryaddress1'] = library_address | ||
|
|
||
| # Submit verification request with retry | ||
| max_retries = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this hardcoded value be here? Isn't it also set somewhere else?
d10c6d9 to
547d643
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions.
| import json | ||
| from typing import Dict, Any, Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Json, Dict and Any seems to be unused.
scripts/verification/README.md
Outdated
| # ✅ Correct way - run as module | ||
| python3 -m scripts.verification.test_retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test name needs updating here.
Enhanced Contract Verification with Retry Mechanisms and Multi-Explorer Support
🎯 Summary
Enhances
scripts/verify.pyto eliminate single points of failure when verifying Sky Protocol spells. Adds robust retry mechanisms and support for multiple block explorers (Etherscan + Sourcify) with automatic fallback.🔧 Key Changes
Retry Mechanisms
Multi-Explorer Support
Enhanced Error Handling
📝 Files Changed
scripts/verify.py- Enhanced with retry mechanisms and multi-verifier supportscripts/verification/README.md- Updated documentationscripts/verification/test_retry.py- Simple test for the retry mechanism⚙️ Usage (Unchanged)
✅ Benefits
🧪 Testing
🎯 Addresses Requirements
No breaking changes - pure enhancement with full backward compatibility.