-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: add rpc intercept to opsimulator
#54
Conversation
WalkthroughWalkthroughThe changes introduce the capability for the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OpSimulator
participant ReverseProxy
Note over Client,ReverseProxy: HTTP Request Flow
Client->>OpSimulator: HTTP Request (JSON-RPC)
OpSimulator->>OpSimulator: Parse JSON-RPC Request
OpSimulator->>OpSimulator: Check Method (e.g., eth_sendRawTransaction)
OpSimulator->>ReverseProxy: Forward Request
ReverseProxy-->>OpSimulator: Response
OpSimulator-->>Client: HTTP Response
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @tremarkley and the rest of your teammates on Graphite |
62a4821
to
3a77209
Compare
opsimulator
wdyt about using https://github.com/ethereum/go-ethereum/blob/v1.13.15/rpc/handler.go? otherwise we have to write our own logic to handle batches, formatting errors, etc. |
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.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
opsimulator/opsimulator.go (1)
129-131
: Placeholder function is defined correctly!The
checkInteropInvariants
function is a placeholder for future logic. Consider adding a TODO comment to indicate future work.+// TODO: Implement the logic for checking interop transaction invariants.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- opsimulator/opsimulator.go (4 hunks)
Additional comments not posted (1)
opsimulator/opsimulator.go (1)
42-47
: Struct definition looks good!The
JSONRPCRequest
struct is well-defined with appropriate JSON tags.
3a77209
to
d6b37ff
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.
looks good! ignore my comment below, I think we can add more robust json-rpc handling (with batching) later
one nit
d6b37ff
to
aa215f0
Compare
aa215f0
to
5969786
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- opsimulator/opsimulator.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- opsimulator/opsimulator.go
Closes #17
Creates a handler in
opsimulator
that intercepts JSON RPC requests and checks which method is being called. This sets us up to be able to add special handing for interop transactions when theeth_sendRawTransaction
method is called.This does not handle batch transactions, we will need to update the handler to support them: #55
Summary by CodeRabbit
New Features
Future Enhancements