jito-labs / searcher-examples

Searcher Examples
317 stars 126 forks source link

protoc failed: bundle.proto: contains proto3 optional fields #57

Open umaid56 opened 2 months ago

umaid56 commented 2 months ago

Hi, I am facing this issue while cargo build "called Result::unwrap() on an Err value: Custom { kind: Other, error: "protoc failed: bundle.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }"

sonicfromnewyoke commented 2 months ago

yeah, try to follow compiler hint.

in jito_protos/build.rs

use tonic_build::configure;

fn main() {
    configure()
        .protoc_arg("--experimental_allow_proto3_optional")
        .compile(
            &[
                "protos/auth.proto",
                "protos/block.proto",
                "protos/block_engine.proto",
                "protos/bundle.proto",
                "protos/packet.proto",
                "protos/relayer.proto",
                "protos/searcher.proto",
                "protos/shared.proto",
            ],
            &["protos"],
        )
        .unwrap();
}