taikoxyz / raiko

Multi-proofs for Taiko. SNARKS, STARKS and Trusted Execution Enclave. Our previous ZK-EVM circuits are deprecated.
Apache License 2.0
96 stars 75 forks source link

Failed to request proof height=xxx error="failed to request proof, id: xxx, statusCode: 404" endpoint=http://ip :8080 #242

Open Maus313 opened 1 month ago

Maus313 commented 1 month ago

Describe the bug

Has anyone encountered this bug? It happened a few hours ago

Steps to reproduce

Steps to reproduce here.

Spam policy

Programmierus commented 1 month ago

I have similar issue... Made a tcmpdump, here is what a relayer sends to prover:

POST /v1/proof HTTP/1.1
Host: XXXX:8080
User-Agent: Go-http-client/1.1
Content-Length: 424
Content-Type: application/json
Accept-Encoding: gzip

{"rpc":"http://lXXX18547","l1_rpc":"https://XXXX:4443","beacon_rpc":"https://XXXX:6443","block_number":192713,"prover":"XXXXX","graffiti":"0000000000000000000000000000000000000000000000000000000000000000","proof_type":"sgx","sgx":{"setup":false,"bootstrap":false,"prove":true},"risc0":{"bonsai":false,"snark":false,"profile":false,"execution_po2":null}}

And prover returns:

HTTP/1.1 404 Not Found
content-length: 0

Endpoint /v1/proof does not seem to be available (any more?) and the request relayer sends looks actually different from the sample in the docs I used to test the setup...

Damn. I am **ing with this setup already few days. Most evil node.

Programmierus commented 1 month ago

I wrote a small wrapper that ~tries to resoive~ resolves the issue:

from flask import Flask, request, jsonify
import requests
import json
import random

app = Flask(__name__)

@app.route('/v1/proof', methods=['POST'])
def handle_proof():
    if request.method == 'POST':
        # Extract JSON data from request
        data = request.get_json()
        app.logger.info(f"Received request with data: {data}")

        # Modify the 'rpc' URL if it exists
        if 'rpc' in data and data['rpc'] == 'http://l2_execution_engine:18547':
            data['rpc'] = 'https://real_url:4443'

        # Wrap the JSON data
        wrapped_data = {
            "jsonrpc": "2.0",
            "method": "proof",
            "params": [data],
            "id": random.randint(1, 1000)
        }
        app.logger.info(f"Sending wrapped data: {wrapped_data}")

        # Send data to the external server
        response = requests.post('http://real_sgx:8080', json=wrapped_data)
        app.logger.info(f"Received response from external server: {response.json()}")

        answer = {'data': response.json()['result']}
        app.logger.info(f"Answering: {answer}")

        # Return the response from the external server to the client
        return jsonify(answer)

if __name__ == '__main__':
    app.run(port=8080, host='0.0.0.0', debug=True)

~It kinda works, but relayer does not like what it returns and crashes on nil reference. Which is not nice as it might be a problem in the future if bad actors will send something like this to relayers.~

Works.

RogerLamTd commented 1 month ago

@Maus313 @Programmierus Is this on Hekla? Which release of raiko is this?

quangtuyen88 commented 1 month ago

@Maus313 @Programmierus Is this on Hekla? Which release of raiko is this?

I have tested with latest raiko code.. but it's seem more issue with simple taiko node. Since I use latest code for Raiko and old docker image for Simple taiko node and don't get that issue.

This issue only happen when you start Simple Taiko Node with latest docker image

Cippone commented 1 month ago

I also had the same error. I reinstalled everything. So I have the latest version of raiko and the latest version of taiko. Has anyone found a solution?

smtmfft commented 1 month ago

I also had the same error. I reinstalled everything. So I have the latest version of raiko and the latest version of taiko. Has anyone found a solution?

Oh, now we are upgrading both the raiko main & simple-node client, so some mismatchings are expected if you use latest code, we will release a new version soon (in 1 day I think). Please stay tuned. Thanks!

lucajj3 commented 1 month ago

I also had the same error. I reinstalled everything. So I have the latest version of raiko and the latest version of taiko. Has anyone found a solution?

Oh, now we are upgrading both the raiko main & simple-node client, so some mismatchings are expected if you use latest code, we will release a new version soon (in 1 day I think). Please stay tuned. Thanks!

I have same problem. i need reinstall raiko, new wallet, new boodstrap and id? is available faster procedure?

smtmfft commented 1 month ago

Hi, there As https://discord.com/channels/984015101017346058/984087180739768331/1244263386074578995 mentioned. We have upgraded raiko to v1.0.0, and a few 3rd party provers have upgraded & tested. Could you please update and try again? Thanks!

BTW: we added more env flags into raiko, but the default is still on hekla with public rpc nodes.