diff --git a/.gitignore b/.gitignore index 6dbdd3c40..5f6cea3d2 100644 --- a/.gitignore +++ b/.gitignore @@ -62,4 +62,7 @@ localnet_config.yaml # Relase artifacts produced by `ignite chain build --release` release +# SMT KVStore files +smt + go.work.sum diff --git a/config.yml b/config.yml index f21fe2be6..27af27ff8 100644 --- a/config.yml +++ b/config.yml @@ -100,7 +100,7 @@ genesis: - endpoints: - configs: [] rpc_type: JSON_RPC - url: http://anvil:8547 + url: http://localhost:8548 service: id: anvil name: "" diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index 1f31b70ad..225d52789 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -267,7 +267,7 @@ func supplyRelayerProxy( cmd *cobra.Command, ) (depinject.Config, error) { // TODO_TECHDEBT: this should be populated from some relayerProxy config. - anvilURL, err := url.Parse("ws://anvil:8547/") + anvilURL, err := url.Parse("http://localhost:8547/") if err != nil { return nil, err } diff --git a/pkg/relayer/proxy/jsonrpc.go b/pkg/relayer/proxy/jsonrpc.go index bf7736f33..a037bd567 100644 --- a/pkg/relayer/proxy/jsonrpc.go +++ b/pkg/relayer/proxy/jsonrpc.go @@ -162,23 +162,16 @@ func (jsrv *jsonRPCServer) serveHTTP(ctx context.Context, request *http.Request) // Build the request to be sent to the native service by substituting // the destination URL's host with the native service's listen address. - // TODO_HACK: Currently, the native service's listen address is hardcoded to localhost:8547. - // This should be changed to the actual listen address of the native service. - // However, the native service 'ws://anvil:8547' causes errors log.Printf("DEBUG: Building relay request to native service %s...", jsrv.proxiedServiceEndpoint.String()) - destinationURL, err := url.Parse(request.URL.String()) if err != nil { return nil, err } - destinationURL.Host = "localhost:8547" - destinationURL.Scheme = "http" // this is not captured and needs to be set - log.Printf("DEBUG: Sending relay request to native service %s...", destinationURL.String()) relayHTTPRequest := &http.Request{ Method: request.Method, Header: request.Header, - URL: destinationURL, - Host: destinationURL.Host, + URL: &jsrv.proxiedServiceEndpoint, + Host: jsrv.proxiedServiceEndpoint.Host, Body: requestBodyReader, } diff --git a/pkg/relayer/session/session.go b/pkg/relayer/session/session.go index c8f2ad30b..0a0f66aff 100644 --- a/pkg/relayer/session/session.go +++ b/pkg/relayer/session/session.go @@ -154,7 +154,11 @@ func (rs *relayerSessionsManager) mapBlockToSessionsToClaim( // Iterate over the sessionsTrees map to get the ones that end at a block height // lower than the current block height. for endBlockHeight, sessionsTreesEndingAtBlockHeight := range rs.sessionsTrees { - if endBlockHeight < block.Height() { + // TODO: We need this to be == instead of <= because we don't want to keep sending + // the same session while waiting the next step. This does not address the case + // where the block client misses the target block which should be handled by the + // retry mechanism. + if endBlockHeight == block.Height() { // Iterate over the sessionsTrees that end at this block height (or // less) and add them to the list of sessionTrees to be published. for _, sessionTree := range sessionsTreesEndingAtBlockHeight {