-
Notifications
You must be signed in to change notification settings - Fork 201
[Ledger Service] Add more improvements #8350
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: leo/poc-ledger-service
Are you sure you want to change the base?
[Ledger Service] Add more improvements #8350
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! 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 |
| // gRPC client accepts "unix:///absolute/path" or "unix://relative/path" format | ||
| // If address starts with unix://, use it as-is (gRPC handles the format) | ||
| normalizedAddr := grpcAddr | ||
| isUnixSocket := strings.HasPrefix(grpcAddr, "unix://") |
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.
Improvement 1: Use unix domain socket to improve the performance of sending data inter process.
| if err != nil { | ||
| return nil, fmt.Errorf("failed to connect to ledger service: %w", err) | ||
| // Retry connection with exponential backoff until the service becomes available. | ||
| var conn *grpc.ClientConn |
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.
Improvement 2: Added retry, so that we can restart the ledger service, without restarting the execution service. The retry will allow the block execution to resume automatically after ledger finish restarting.
It also allows both service to restart at the same time.
cmd/ledger/main.go
Outdated
| triedir = flag.String("triedir", "", "Directory for trie files (required)") | ||
| ledgerServiceTCP = flag.String("ledger-service-tcp", "", "Ledger service TCP listen address (e.g., 0.0.0.0:9000). If provided, server accepts TCP connections.") | ||
| ledgerServiceSocket = flag.String("ledger-service-socket", "", "Ledger service Unix socket path (e.g., /sockets/ledger.sock). If provided, server accepts Unix socket connections. Can specify multiple sockets separated by comma.") | ||
| adminAddr = flag.String("admin-addr", "", "Address to bind on for admin HTTP server (e.g., 0.0.0.0:9002). If provided, enables admin commands.") |
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.
Improvement 3: Added admin tool for triggering checkpoints on ledger service
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Works on top of #8309
This PR includes improvements:
Improvement 1: Use unix domain socket to improve the performance of sending data inter process.
Improvement 2: Added retry, so that we can restart the ledger service, without restarting the execution service. The retry will allow the block execution to resume automatically after ledger finish restarting.
Improvement 3: Added admin tool for triggering checkpoints on ledger service
Improvement 4: Added metrics for ledger service.