Support debug_traceCall API (#192)

* Implement debug_traceCall API

* Use API implementation from geth with custom backend

* Update refs in GitHub workflow
This commit was merged in pull request #192.
This commit is contained in:
prathamesh0
2022-09-21 17:15:03 +05:30
committed by GitHub
parent 4d99ecdee3
commit 2c03c8cbd0
10 changed files with 85 additions and 13 deletions
+2
View File
@@ -219,6 +219,8 @@ func NewConfig() (*Config, error) {
if rpcGasCap, ok := new(big.Int).SetString(rpcGasCapStr, 10); ok {
c.RPCGasCap = rpcGasCap
}
} else {
c.RPCGasCap = big.NewInt(0)
}
chainConfigPath := viper.GetString("ethereum.chainConfig")
if chainConfigPath != "" {
+15 -6
View File
@@ -24,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/tracers"
ethnode "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp"
@@ -31,6 +32,7 @@ import (
"github.com/jmoiron/sqlx"
log "github.com/sirupsen/logrus"
"github.com/cerc-io/ipld-eth-server/v4/pkg/debug"
"github.com/cerc-io/ipld-eth-server/v4/pkg/eth"
"github.com/cerc-io/ipld-eth-server/v4/pkg/net"
)
@@ -139,16 +141,23 @@ func (sap *Service) APIs() []rpc.API {
Public: true,
},
}
ethAPI, err := eth.NewPublicEthAPI(sap.backend, sap.client, sap.supportsStateDiffing, sap.forwardEthCalls, sap.proxyOnError)
if err != nil {
log.Fatalf("unable to create public eth api: %v", err)
}
return append(apis, rpc.API{
Namespace: eth.APIName,
Version: eth.APIVersion,
Service: ethAPI,
Public: true,
})
debugTracerAPI := tracers.APIs(&debug.Backend{Backend: *sap.backend})[0]
return append(apis,
rpc.API{
Namespace: eth.APIName,
Version: eth.APIVersion,
Service: ethAPI,
Public: true,
},
debugTracerAPI,
)
}
// Serve listens for incoming converter data off the screenAndServePayload from the Sync process