Skip to content

Commit

Permalink
web3, log null transaction receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
superisaac committed Mar 13, 2024
1 parent ebf43c4 commit b1ef629
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions chains/web3.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ func (self *Web3Chain) DelegateRPC(ctx context.Context, m *nodemuxcore.Multiplex
useCache, resmsgFromCache := jsonrpcCacheFetchForMethods(
ctx, m, chain, reqmsg,
"eth_getTransactionByHash",
"eth_getTransactionReceipt")
//"eth_getTransactionReceipt",
)

if resmsgFromCache != nil {
return resmsgFromCache, nil
Expand All @@ -193,7 +194,8 @@ func (self *Web3Chain) DelegateRPC(ctx context.Context, m *nodemuxcore.Multiplex
if endpoint, ok := presenceCacheMatchRequest(
ctx, m, chain, reqmsg,
"eth_getTransactionByHash",
"eth_getTransactionReceipt"); ok {
//"eth_getTransactionReceipt",
); ok {
retmsg, err := endpoint.CallRPC(ctx, reqmsg)
if err == nil && useCache && retmsg.IsResult() {
jsonrpcCacheUpdate(ctx, m, chain, reqmsg, retmsg.(*jsoff.ResultMessage), time.Second*600)
Expand All @@ -205,6 +207,15 @@ func (self *Web3Chain) DelegateRPC(ctx context.Context, m *nodemuxcore.Multiplex
if h, ok := self.findBlockHeight(reqmsg); ok {
return m.DefaultRelayRPC(ctx, chain, reqmsg, h)
}
} else if reqmsg.Method == "eth_getTransactionReceipt" {
retmsg, err := m.DefaultRelayRPC(ctx, chain, reqmsg, -2)
if err != nil {
return retmsg, err
} else if respMsg, ok := retmsg.(*jsoff.ResultMessage); ok && respMsg.Result == nil {
viaEp := respMsg.ResponseHeader().Get("X-Real-Endpoint")
respMsg.Log().Infof("null transaction receipt %s", viaEp)
}
return retmsg, err
}
//return m.DefaultRelayRPC(ctx, chain, reqmsg, -2)
retmsg, err := m.DefaultRelayRPC(ctx, chain, reqmsg, -2)
Expand Down

0 comments on commit b1ef629

Please sign in to comment.