Skip to content
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

Log request url for eth_sendRawTransaction #142

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions server/request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ func (r *RpcRequestHandler) process() {
r.logger = r.logger.New("rpc_method", jsonReq.Method)

// Process single request
r.processRequest(client, jsonReq, origin, referer, isWhitehatBundleCollection, whitehatBundleId, urlParams)
r.processRequest(client, jsonReq, origin, referer, isWhitehatBundleCollection, whitehatBundleId, urlParams, r.req.URL.String())
}

// processRequest handles single request
func (r *RpcRequestHandler) processRequest(client RPCProxyClient, jsonReq *types.JsonRpcRequest, origin, referer string, isWhitehatBundleCollection bool, whitehatBundleId string, urlParams URLParameters) {
func (r *RpcRequestHandler) processRequest(client RPCProxyClient, jsonReq *types.JsonRpcRequest, origin, referer string, isWhitehatBundleCollection bool, whitehatBundleId string, urlParams URLParameters, reqURL string) {
var entry *database.EthSendRawTxEntry
if jsonReq.Method == "eth_sendRawTransaction" {
entry = r.requestRecord.AddEthSendRawTxEntry(uuid.New())
// log the full url for debugging
r.logger.Info("[processRequest] Request URL", "url", reqURL)
TymKh marked this conversation as resolved.
Show resolved Hide resolved
}
// Handle single request
rpcReq := NewRpcRequest(r.logger, client, jsonReq, r.relaySigningKey, r.relayUrl, origin, referer, isWhitehatBundleCollection, whitehatBundleId, entry, urlParams, r.chainID, r.rpcCache)
Expand All @@ -149,7 +151,6 @@ func (r *RpcRequestHandler) finishRequest() {
if err := r.requestRecord.SaveRecord(); err != nil {
log.Error("saveRecord failed", "requestId", r.requestRecord.requestEntry.Id, "error", err, "requestId", r.uid)
}

}()
r.logger.Info("Request finished", "duration", reqDuration.Seconds())
}
Loading