diff --git a/.github/actions/setup-build-deps/action.yml b/.github/actions/setup-build-deps/action.yml index 57cde74e03..6e9b511557 100644 --- a/.github/actions/setup-build-deps/action.yml +++ b/.github/actions/setup-build-deps/action.yml @@ -1,5 +1,5 @@ name: 'Setup Build Dependencies' -description: 'Install system dependencies required for building OpenMina' +description: 'Install system dependencies required for building Mina' inputs: include-sqlite: description: 'Include SQLite3 in the installation' diff --git a/.github/actions/setup-circuits/action.yml b/.github/actions/setup-circuits/action.yml index 3317b7347c..1a29df486c 100644 --- a/.github/actions/setup-circuits/action.yml +++ b/.github/actions/setup-circuits/action.yml @@ -1,5 +1,5 @@ name: 'Download Circuit Files' -description: 'Download required circuit files for OpenMina' +description: 'Download required circuit files for Mina' runs: using: 'composite' steps: diff --git a/.github/actions/setup-container-deps/action.yml b/.github/actions/setup-container-deps/action.yml index 6dc86c9456..5ac40c069f 100644 --- a/.github/actions/setup-container-deps/action.yml +++ b/.github/actions/setup-container-deps/action.yml @@ -1,5 +1,5 @@ name: 'Setup Container Dependencies' -description: 'Install libssl3t64 in container for OpenMina binaries' +description: 'Install libssl3t64 in container for Mina binaries' runs: using: 'composite' steps: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04fd3d77e0..428f114990 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Openmina CI +name: Mina CI on: push: branches: [ main, develop ] @@ -15,7 +15,7 @@ on: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full - OPENMINA_PANIC_ON_BUG: true + MINA_PANIC_ON_BUG: true CARGO_INCREMENTAL: 1 RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off" @@ -165,7 +165,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: bin-${{ github.sha }} - path: target/release/openmina + path: target/release/mina retention-days: 7 build-wasm: @@ -331,7 +331,7 @@ jobs: options: --volume debugger_data:/tmp/db env: # to allow local addrs discovery - OPENMINA_DISCOVERY_FILTER_ADDR: false + MINA_DISCOVERY_FILTER_ADDR: false # to allow connection with replayer # TODO: remove when replayer supports identify KEEP_CONNECTION_WITH_UNKNOWN_STREAM: true @@ -417,7 +417,7 @@ jobs: image: gcr.io/o1labs-192920/mina-daemon:3.2.0-beta2-939b08d-noble-devnet env: # to allow local addrs discovery - OPENMINA_DISCOVERY_FILTER_ADDR: false + MINA_DISCOVERY_FILTER_ADDR: false strategy: matrix: test: [record_replay, webrtc_record_replay] @@ -450,7 +450,7 @@ jobs: needs: [ build, build-tests ] runs-on: ubuntu-24.04 env: - OPENMINA_HOME: data + MINA_HOME: data BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0 services: @@ -479,7 +479,7 @@ jobs: - name: Fix permissions run: | - chmod +x bootstrap openmina + chmod +x bootstrap mina # TODO: use curl - name: Wait for the debugger @@ -488,13 +488,13 @@ jobs: - name: Bootstrap node env: - OPENMINA_COMMAND: openmina + MINA_COMMAND: mina NO_PEER_DISCOVERY: "true" - OUT_PATH: ${{ env.OPENMINA_HOME }}/logs/bootstrap_output + OUT_PATH: ${{ env.MINA_HOME }}/logs/bootstrap_output RECORD: state-with-input-actions run: | mkdir -p $OUT_PATH - PATH=$PATH:$(pwd) OPENMINA_COMMAND=openmina NO_PEER_DISCOVERY=true ./bootstrap --nocapture || { + PATH=$PATH:$(pwd) MINA_COMMAND=mina NO_PEER_DISCOVERY=true ./bootstrap --nocapture || { echo "::group::Stderr" cat $OUT_PATH.stderr echo "::endgroup::" @@ -505,7 +505,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: bootstrap-logs-${{ github.sha }} - path: ${{ env.OPENMINA_HOME }}/logs/* + path: ${{ env.MINA_HOME }}/logs/* retention-days: 7 if: ${{ failure() }} @@ -513,7 +513,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: bootstrap-record-${{ github.sha }} - path: ${{ env.OPENMINA_HOME }}/recorder/* + path: ${{ env.MINA_HOME }}/recorder/* retention-days: 7 if: ${{ failure() }} diff --git a/.github/workflows/doc-commands.yaml b/.github/workflows/doc-commands.yaml index e2abe75495..f6750b2ac0 100644 --- a/.github/workflows/doc-commands.yaml +++ b/.github/workflows/doc-commands.yaml @@ -47,20 +47,20 @@ jobs: - name: Verify generated key file run: | echo "Verifying generated key file exists and has correct permissions..." - if [ ! -f "./openmina-workdir/producer-key" ]; then + if [ ! -f "./mina-workdir/producer-key" ]; then echo "❌ Producer key file was not generated" exit 1 fi # Check file permissions (should be 600) - PERMS=$(stat -c "%a" "./openmina-workdir/producer-key") + PERMS=$(stat -c "%a" "./mina-workdir/producer-key") if [ "$PERMS" != "600" ]; then echo "❌ Producer key file has incorrect permissions: $PERMS (expected: 600)" exit 1 fi # Check file is not empty - if [ ! -s "./openmina-workdir/producer-key" ]; then + if [ ! -s "./mina-workdir/producer-key" ]; then echo "❌ Producer key file is empty" exit 1 fi @@ -72,7 +72,7 @@ jobs: echo "Testing that generated key can be used by run-block-producer target..." # Run with --help to avoid actually starting the producer but verify # key validation passes - timeout 30s make run-block-producer NETWORK=devnet COINBASE_RECEIVER=$(cat ./openmina-workdir/producer-key.pub) || { + timeout 30s make run-block-producer NETWORK=devnet COINBASE_RECEIVER=$(cat ./mina-workdir/producer-key.pub) || { EXIT_CODE=$? if [ $EXIT_CODE -eq 124 ]; then echo "✅ Command started successfully (timed out as expected)" @@ -87,34 +87,34 @@ jobs: - name: Test generate-block-producer-key with custom filename run: | echo "Testing generate-block-producer-key with custom PRODUCER_KEY_FILENAME..." - make generate-block-producer-key PRODUCER_KEY_FILENAME=./openmina-workdir/custom-producer-key + make generate-block-producer-key PRODUCER_KEY_FILENAME=./mina-workdir/custom-producer-key # Verify custom private key file exists - if [ ! -f "./openmina-workdir/custom-producer-key" ]; then + if [ ! -f "./mina-workdir/custom-producer-key" ]; then echo "❌ Custom producer key file was not generated" exit 1 fi # Verify custom public key file exists - if [ ! -f "./openmina-workdir/custom-producer-key.pub" ]; then + if [ ! -f "./mina-workdir/custom-producer-key.pub" ]; then echo "❌ Custom producer public key file was not generated" exit 1 fi # Check file permissions (should be 600 for private key) - PERMS=$(stat -c "%a" "./openmina-workdir/custom-producer-key") + PERMS=$(stat -c "%a" "./mina-workdir/custom-producer-key") if [ "$PERMS" != "600" ]; then echo "❌ Custom producer key file has incorrect permissions: $PERMS (expected: 600)" exit 1 fi # Check both files are not empty - if [ ! -s "./openmina-workdir/custom-producer-key" ]; then + if [ ! -s "./mina-workdir/custom-producer-key" ]; then echo "❌ Custom producer key file is empty" exit 1 fi - if [ ! -s "./openmina-workdir/custom-producer-key.pub" ]; then + if [ ! -s "./mina-workdir/custom-producer-key.pub" ]; then echo "❌ Custom producer public key file is empty" exit 1 fi @@ -132,7 +132,7 @@ jobs: fi # Try to generate keys again with custom filename (should fail) - if make generate-block-producer-key PRODUCER_KEY_FILENAME=./openmina-workdir/custom-producer-key 2>/dev/null; then + if make generate-block-producer-key PRODUCER_KEY_FILENAME=./mina-workdir/custom-producer-key 2>/dev/null; then echo "❌ Command should have failed when custom keys already exist" exit 1 fi diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 8d949d5724..34bf24067f 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,4 +1,4 @@ -name: OpenMina Docker Build +name: Mina Docker Build on: workflow_dispatch: {} push: @@ -11,7 +11,7 @@ env: REGISTRY_FRONTEND_IMAGE: openmina/frontend jobs: - build-openmina-node-image: + build-mina-node-image: timeout-minutes: 40 strategy: matrix: @@ -63,7 +63,7 @@ jobs: retention-days: 1 # Frontend - build-openmina-frontend-image: + build-mina-frontend-image: timeout-minutes: 5 strategy: matrix: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3fe6729b40..675a4c243b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -161,14 +161,14 @@ jobs: - name: Create versioned documentation archive run: | cd website/build - tar -czf "../../openmina-docs-${{ steps.version.outputs.version }}.tar.gz" . + tar -czf "../../mina-docs-${{ steps.version.outputs.version }}.tar.gz" . cd ../.. - zip -r "openmina-docs-${{ steps.version.outputs.version }}.zip" website/build + zip -r "mina-docs-${{ steps.version.outputs.version }}.zip" website/build - name: Upload versioned documentation as release asset uses: actions/upload-artifact@v4 with: name: versioned-docs-${{ steps.version.outputs.version }} path: | - openmina-docs-${{ steps.version.outputs.version }}.tar.gz - openmina-docs-${{ steps.version.outputs.version }}.zip + mina-docs-${{ steps.version.outputs.version }}.tar.gz + mina-docs-${{ steps.version.outputs.version }}.zip diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a8e930265..f11e7b59d9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ jobs: - name: Create versioned directory and package files run: | - release_dir="openmina-${{ github.ref_name }}-docker-compose" + release_dir="mina-${{ github.ref_name }}-docker-compose" mkdir -p "$release_dir" cp -r docker-compose.* README.md "$release_dir/" zip -r "${release_dir}.zip" "$release_dir" @@ -38,8 +38,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_name: "openmina-${{ github.ref_name }}-docker-compose.zip" - asset_path: "openmina-${{ github.ref_name }}-docker-compose.zip" + asset_name: "mina-${{ github.ref_name }}-docker-compose.zip" + asset_path: "mina-${{ github.ref_name }}-docker-compose.zip" asset_content_type: application/zip - name: Upload the tarball as a release asset @@ -48,6 +48,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_name: "openmina-${{ github.ref_name }}-docker-compose.tar.gz" - asset_path: "openmina-${{ github.ref_name }}-docker-compose.tar.gz" + asset_name: "mina-${{ github.ref_name }}-docker-compose.tar.gz" + asset_path: "mina-${{ github.ref_name }}-docker-compose.tar.gz" asset_content_type: application/gzip diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 4653ab74fe..e5ca70ed0b 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -24,7 +24,7 @@ pub enum P2pAction { ``` link to the definition of the node("root") action: -[openmina_node::Action](node/src/action.rs). +[mina_node::Action](node/src/action.rs). ## Enabling Condition @@ -99,7 +99,7 @@ type Reducer = fn(&mut State, &Action); ``` Main reducer function that gets called on every action: -[openmina_node::reducer](node/src/reducer.rs). +[mina_node::reducer](node/src/reducer.rs). ## Effects(side-effects) @@ -120,7 +120,7 @@ type Effects = fn(&mut Store, &A ``` Main effects function that gets called on every action: -[openmina_node::effects](node/src/effects.rs). +[mina_node::effects](node/src/effects.rs). ## Service @@ -135,7 +135,7 @@ in another thread. ## State -Our global state. [openmina_node::State](node/src/state.rs) +Our global state. [mina_node::State](node/src/state.rs) ## Store @@ -216,8 +216,8 @@ There are 2 types of effects: For example, we could receive rpc request on p2p layer to send our current best tip. Since [p2p](p2p/) is in a separate crate, it's not even possible to answer that rpc there, as in that crate, we only have partial view (p2p part) - of the state. But we do have that access in [openmina-node](node/) crate, so - we write effects to respond to that rpc + of the state. But we do have that access in [mina-node](node/) crate, so we + write effects to respond to that rpc [in there](https://github.com/openmina/openmina/blob/f6bde2138157dcdacd4baa0cd07c22506dc2a7c0/node/src/p2p/p2p_effects.rs#L517). Examples of the flow: diff --git a/CHANGELOG.md b/CHANGELOG.md index f31d704078..5dbb5e5874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Website**: (temporary) new design, for a first release and rename OpenMina to "the Mina Russt node" ([#1312](https://github.com/o1-labs/openmina/pull/1312)). +- **Codebase**: rename `openmina` to `mina`, the project being officially + called for now "the Mina Rust node" + ([#1314](https://github.com/o1-labs/openmina/pull/1312)). ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index c8164672b1..219cb16aa2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,10 +1,10 @@ -# OpenMina Codebase Navigation Guide +# Mina Codebase Navigation Guide -This file helps understand and navigate the OpenMina codebase structure. +This file helps understand and navigate the Mina codebase structure. ## Project Overview -OpenMina is a Rust implementation of the Mina Protocol, a lightweight blockchain +Mina is a Rust implementation of the Mina Protocol, a lightweight blockchain using zero-knowledge proofs. It follows a Redux-style state machine architecture for predictable, debuggable behavior. @@ -127,7 +127,7 @@ Each component directory contains a `summary.md` file documenting: ## Documentation Website -OpenMina includes a comprehensive documentation website built with Docusaurus: +Mina includes a comprehensive documentation website built with Docusaurus: ### Quick Access diff --git a/Cargo.lock b/Cargo.lock index 870bc0a544..5bd77549fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1698,14 +1698,14 @@ dependencies = [ "dialoguer", "hex", "libp2p-identity", + "mina-core", + "mina-node-account", + "mina-node-native", "mina-p2p-messages", "mina-tree", "nix 0.26.4", "node", "num_cpus", - "openmina-core", - "openmina-node-account", - "openmina-node-native", "rand", "rayon", "redux", @@ -3610,9 +3610,9 @@ dependencies = [ "dotenv", "firestore", "gcloud-sdk", + "mina-core", "mina-p2p-messages", "mina-tree", - "openmina-core", "serde", "serde_json", "snark", @@ -5090,228 +5090,562 @@ dependencies = [ ] [[package]] -name = "mina-curves" -version = "0.1.0" -source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" +name = "mina-archive-breadcrumb-compare" +version = "0.16.0" dependencies = [ - "ark-ec", - "ark-ff", + "anyhow", + "binprot", + "clap 4.5.20", + "mina-p2p-messages", + "reqwest 0.11.24", + "serde", + "serde_json", + "similar", + "tokio", ] [[package]] -name = "mina-hasher" -version = "0.1.0" -source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" +name = "mina-bootstrap-sandbox" +version = "0.16.0" dependencies = [ - "ark-ff", - "bitvec", + "base64 0.22.0", + "binprot", + "bs58 0.5.0", + "env_logger", + "libp2p", + "libp2p-rpc-behaviour", + "log", + "mina-core", "mina-curves", - "mina-poseidon", - "o1-utils", + "mina-p2p-messages", + "mina-signer", + "mina-transport", + "mina-tree", + "rand", "serde", + "serde_json", + "structopt", + "thiserror 1.0.60", + "tokio", ] [[package]] -name = "mina-p2p-messages" -version = "0.6.4" +name = "mina-core" +version = "0.16.0" dependencies = [ - "alloc-test", - "anyhow", + "argon2", "ark-ff", "base64 0.22.0", "binprot", "binprot_derive", - "blake2", "bs58 0.4.0", - "clap 4.5.20", - "derive_more", - "fuzzcheck", + "crypto_secretbox", + "flume", "graphannis-malloc_size_of", "graphannis-malloc_size_of_derive", "hex", + "js-sys", "lazy_static", + "libp2p-identity", + "md5", "mina-curves", + "mina-fuzzer", "mina-hasher", - "mina-signer", - "num-bigint", - "o1-utils", - "openmina-macros", + "mina-macros", + "mina-p2p-messages", + "multihash 0.18.1", + "once_cell", "poseidon", - "rsexp", - "rsexp-derive", + "rand", + "redux", "serde", - "serde_bytes", "serde_json", "sha2 0.10.8", - "strum 0.26.2", - "strum_macros 0.26.4", + "slab", "thiserror 1.0.60", "time", - "toml 0.5.11", + "tokio", + "tracing", "wasm-bindgen", - "wasm-bindgen-test", + "wasm-bindgen-futures", + "wasm_thread", "web-sys", ] [[package]] -name = "mina-poseidon" +name = "mina-curves" version = "0.1.0" source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" dependencies = [ "ark-ec", "ark-ff", - "ark-poly", - "mina-curves", - "o1-utils", - "once_cell", +] + +[[package]] +name = "mina-fuzzer" +version = "0.16.0" +dependencies = [ + "lazy_static", "rand", - "rayon", + "rand_distr", "serde", - "serde_with 1.14.0", + "serde_json", ] [[package]] -name = "mina-signer" +name = "mina-gossipsub-sandbox" +version = "0.16.0" +dependencies = [ + "bs58 0.5.0", + "env_logger", + "libp2p", + "log", + "mina-transport", + "rand", + "structopt", + "tokio", +] + +[[package]] +name = "mina-hasher" version = "0.1.0" source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" dependencies = [ - "ark-ec", "ark-ff", "bitvec", - "blake2", - "bs58 0.4.0", - "hex", "mina-curves", - "mina-hasher", + "mina-poseidon", "o1-utils", - "rand", - "sha2 0.10.8", - "thiserror 1.0.60", + "serde", ] [[package]] -name = "mina-transport" +name = "mina-macros" version = "0.16.0" dependencies = [ - "blake2", - "hex", - "libp2p", - "log", - "pin-project-lite", + "anyhow", + "mina-core", + "proc-macro2 1.0.95", + "quote 1.0.35", + "rust-format", + "syn 2.0.96", + "tracing", ] [[package]] -name = "mina-tree" +name = "mina-node-account" version = "0.16.0" dependencies = [ "anyhow", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize 0.3.0", - "backtrace", - "base64 0.13.1", - "bitvec", - "blake2", "bs58 0.4.0", - "crc32fast", - "derive_more", - "fraction", - "getrandom", "hex", - "itertools 0.12.0", - "juniper", - "kimchi", "lazy_static", - "libc", - "mina-curves", + "mina-core", "mina-hasher", "mina-p2p-messages", - "mina-poseidon", "mina-signer", - "num-bigint", - "o1-utils", - "ocaml-interop", - "once_cell", - "openmina-core", - "openmina-macros", - "poly-commitment", - "poseidon", - "postcard", "rand", - "rand_pcg", - "rand_seeder", + "serde", + "serde_json", + "thiserror 1.0.60", +] + +[[package]] +name = "mina-node-common" +version = "0.16.0" +dependencies = [ + "anyhow", + "ark-ff", + "aws-config", + "aws-sdk-s3", + "binprot", + "binprot_derive", + "bitflags 2.8.0", + "gloo-timers", + "gloo-utils", + "google-cloud-auth", + "google-cloud-storage", + "jsonpath-rust", + "libp2p-identity", + "mina-core", + "mina-p2p-messages", + "mina-signer", + "mina-tree", + "mio 1.0.3", + "node", + "rand", "rayon", "redux", - "reqwest 0.11.24", + "reqwest 0.12.12", "rsa", "serde", "serde_json", - "serde_with 3.7.0", - "sha2 0.10.8", - "strum 0.26.2", - "strum_macros 0.26.4", + "sha3", "thiserror 1.0.60", - "tuple-map", - "uuid", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", + "tracing-wasm", + "vrf", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-bindgen-test", - "web-sys", - "zstd", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", ] [[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +name = "mina-node-invariants" +version = "0.16.0" dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.52.0", + "documented", + "lazy_static", + "node", + "redux", + "serde", + "serde_json", + "strum 0.26.2", + "strum_macros 0.26.4", ] [[package]] -name = "multer" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +name = "mina-node-native" +version = "0.16.0" dependencies = [ + "anyhow", + "bs58 0.4.0", "bytes", - "encoding_rs", - "futures-util", - "http 0.2.9", - "httparse", - "log", - "memchr", + "dataloader", + "derive_more", + "getrandom", + "hex", + "jsonpath-rust", + "juniper", + "juniper_warp", + "libp2p-identity", + "mina-core", + "mina-node-common", + "mina-p2p-messages", + "mina-producer-dashboard", + "mina-signer", + "mina-tree", + "nix 0.26.4", + "node", + "o1-utils", + "rand", + "rayon", + "redux", + "reqwest 0.11.24", + "serde", + "serde_json", + "sha3", + "strum 0.26.2", + "strum_macros 0.26.4", + "thiserror 1.0.60", + "tokio", + "tracing", + "tracing-subscriber", + "vrf", + "warp", +] + +[[package]] +name = "mina-node-testing" +version = "0.16.0" +dependencies = [ + "anyhow", + "axum", + "base64 0.22.0", + "bs58 0.4.0", + "clap 4.5.20", + "console", + "ctrlc", + "derive_more", + "documented", + "hex", + "lazy_static", + "libp2p", + "libp2p-identity", + "mina-core", + "mina-node-invariants", + "mina-node-native", + "mina-p2p-messages", + "mina-tree", + "multiaddr", + "multihash 0.18.1", + "nix 0.27.1", + "node", + "num_cpus", + "postcard", + "rand", + "rayon", + "redux", + "reqwest 0.11.24", + "serde", + "serde_json", + "strum 0.26.2", + "strum_macros 0.26.4", + "temp-dir", + "thiserror 1.0.60", + "time", + "tokio", + "tower-http", + "tracing", + "tracing-log", + "vrf", +] + +[[package]] +name = "mina-node-web" +version = "0.16.0" +dependencies = [ + "anyhow", + "bytes", + "console_error_panic_hook", + "derive_more", + "gloo-utils", + "js-sys", + "jsonpath-rust", + "libp2p-identity", + "mina-node-common", + "mina-p2p-messages", + "mina-signer", + "mina-tree", + "node", + "rand", + "rayon", + "redux", + "serde", + "serde_json", + "thiserror 1.0.60", + "vrf", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "mina-p2p-messages" +version = "0.6.4" +dependencies = [ + "alloc-test", + "anyhow", + "ark-ff", + "base64 0.22.0", + "binprot", + "binprot_derive", + "blake2", + "bs58 0.4.0", + "clap 4.5.20", + "derive_more", + "fuzzcheck", + "graphannis-malloc_size_of", + "graphannis-malloc_size_of_derive", + "hex", + "lazy_static", + "mina-curves", + "mina-hasher", + "mina-macros", + "mina-signer", + "num-bigint", + "o1-utils", + "poseidon", + "rsexp", + "rsexp-derive", + "serde", + "serde_bytes", + "serde_json", + "sha2 0.10.8", + "strum 0.26.2", + "strum_macros 0.26.4", + "thiserror 1.0.60", + "time", + "toml 0.5.11", + "wasm-bindgen", + "wasm-bindgen-test", + "web-sys", +] + +[[package]] +name = "mina-poseidon" +version = "0.1.0" +source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "mina-curves", + "o1-utils", + "once_cell", + "rand", + "rayon", + "serde", + "serde_with 1.14.0", +] + +[[package]] +name = "mina-producer-dashboard" +version = "0.16.0" +dependencies = [ + "bincode", + "clap 4.5.20", + "dotenvy", + "graphql_client", + "mina-node-account", + "mina-p2p-messages", + "num-bigint", + "num-traits", + "reqwest 0.11.24", + "serde", + "serde_json", + "sled", + "sqlx", + "thiserror 1.0.60", + "time", + "tokio", + "vrf", + "warp", +] + +[[package]] +name = "mina-signer" +version = "0.1.0" +source = "git+https://github.com/openmina/proof-systems?rev=f461b4b#f461b4bf65fe9677f81033ed7c3c4f997caea3fe" +dependencies = [ + "ark-ec", + "ark-ff", + "bitvec", + "blake2", + "bs58 0.4.0", + "hex", + "mina-curves", + "mina-hasher", + "o1-utils", + "rand", + "sha2 0.10.8", + "thiserror 1.0.60", +] + +[[package]] +name = "mina-transport" +version = "0.16.0" +dependencies = [ + "blake2", + "hex", + "libp2p", + "log", + "pin-project-lite", +] + +[[package]] +name = "mina-tree" +version = "0.16.0" +dependencies = [ + "anyhow", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize 0.3.0", + "backtrace", + "base64 0.13.1", + "bitvec", + "blake2", + "bs58 0.4.0", + "crc32fast", + "derive_more", + "fraction", + "getrandom", + "hex", + "itertools 0.12.0", + "juniper", + "kimchi", + "lazy_static", + "libc", + "mina-core", + "mina-curves", + "mina-hasher", + "mina-macros", + "mina-p2p-messages", + "mina-poseidon", + "mina-signer", + "num-bigint", + "o1-utils", + "ocaml-interop", + "once_cell", + "poly-commitment", + "poseidon", + "postcard", + "rand", + "rand_pcg", + "rand_seeder", + "rayon", + "redux", + "reqwest 0.11.24", + "rsa", + "serde", + "serde_json", + "serde_with 3.7.0", + "sha2 0.10.8", + "strum 0.26.2", + "strum_macros 0.26.4", + "thiserror 1.0.60", + "tuple-map", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", + "zstd", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "multer" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 0.2.9", + "httparse", + "log", + "memchr", "mime", "spin 0.9.8", "version_check", @@ -5575,15 +5909,15 @@ dependencies = [ "hex", "lazy_static", "linkme", + "mina-core", "mina-curves", "mina-hasher", + "mina-node-account", "mina-p2p-messages", "mina-signer", "mina-tree", "multihash 0.18.1", "num_enum 0.5.11", - "openmina-core", - "openmina-node-account", "p2p", "poseidon", "postcard", @@ -5839,433 +6173,99 @@ dependencies = [ "num-traits", "rand", "rand_core", - "rayon", - "serde", - "serde_with 1.14.0", - "sha2 0.10.8", - "thiserror 1.0.60", -] - -[[package]] -name = "object" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" -dependencies = [ - "memchr", -] - -[[package]] -name = "object" -version = "0.32.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" -dependencies = [ - "memchr", -] - -[[package]] -name = "object" -version = "0.37.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03fd943161069e1768b4b3d050890ba48730e590f57e56d4aa04e7e090e61b4a" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "ocaml-boxroot-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5186393bfbee4ce2bc5bbb82beafb77e85c1d0a557e3cfc8c8a0d63d7845fed5" -dependencies = [ - "cc", -] - -[[package]] -name = "ocaml-interop" -version = "0.8.8" -source = "git+https://github.com/sebastiencs/ocaml-interop.git?branch=closure-values#f9ecf016e725589a402f3d61e120d96b8284d506" -dependencies = [ - "ocaml-boxroot-sys", - "ocaml-sys", - "static_assertions", -] - -[[package]] -name = "ocaml-sys" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ec6ca7d41458442627435afb8f4671e83fd642e8a560171d671a1f679aa3cf" -dependencies = [ - "cty", -] - -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs 0.5.2", -] - -[[package]] -name = "oid-registry" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" -dependencies = [ - "asn1-rs 0.6.2", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openmina-archive-breadcrumb-compare" -version = "0.16.0" -dependencies = [ - "anyhow", - "binprot", - "clap 4.5.20", - "mina-p2p-messages", - "reqwest 0.11.24", - "serde", - "serde_json", - "similar", - "tokio", -] - -[[package]] -name = "openmina-bootstrap-sandbox" -version = "0.16.0" -dependencies = [ - "base64 0.22.0", - "binprot", - "bs58 0.5.0", - "env_logger", - "libp2p", - "libp2p-rpc-behaviour", - "log", - "mina-curves", - "mina-p2p-messages", - "mina-signer", - "mina-transport", - "mina-tree", - "openmina-core", - "rand", - "serde", - "serde_json", - "structopt", - "thiserror 1.0.60", - "tokio", -] - -[[package]] -name = "openmina-core" -version = "0.16.0" -dependencies = [ - "argon2", - "ark-ff", - "base64 0.22.0", - "binprot", - "binprot_derive", - "bs58 0.4.0", - "crypto_secretbox", - "flume", - "graphannis-malloc_size_of", - "graphannis-malloc_size_of_derive", - "hex", - "js-sys", - "lazy_static", - "libp2p-identity", - "md5", - "mina-curves", - "mina-hasher", - "mina-p2p-messages", - "multihash 0.18.1", - "once_cell", - "openmina-fuzzer", - "openmina-macros", - "poseidon", - "rand", - "redux", + "rayon", "serde", - "serde_json", + "serde_with 1.14.0", "sha2 0.10.8", - "slab", "thiserror 1.0.60", - "time", - "tokio", - "tracing", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm_thread", - "web-sys", ] [[package]] -name = "openmina-fuzzer" -version = "0.16.0" +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" dependencies = [ - "lazy_static", - "rand", - "rand_distr", - "serde", - "serde_json", + "memchr", ] [[package]] -name = "openmina-gossipsub-sandbox" -version = "0.16.0" +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ - "bs58 0.5.0", - "env_logger", - "libp2p", - "log", - "mina-transport", - "rand", - "structopt", - "tokio", + "memchr", ] [[package]] -name = "openmina-macros" -version = "0.16.0" +name = "object" +version = "0.37.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03fd943161069e1768b4b3d050890ba48730e590f57e56d4aa04e7e090e61b4a" dependencies = [ - "anyhow", - "openmina-core", - "proc-macro2 1.0.95", - "quote 1.0.35", - "rust-format", - "syn 2.0.96", - "tracing", + "flate2", + "memchr", + "ruzstd", ] [[package]] -name = "openmina-node-account" -version = "0.16.0" +name = "ocaml-boxroot-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5186393bfbee4ce2bc5bbb82beafb77e85c1d0a557e3cfc8c8a0d63d7845fed5" dependencies = [ - "anyhow", - "bs58 0.4.0", - "hex", - "lazy_static", - "mina-hasher", - "mina-p2p-messages", - "mina-signer", - "openmina-core", - "rand", - "serde", - "serde_json", - "thiserror 1.0.60", + "cc", ] [[package]] -name = "openmina-node-common" -version = "0.16.0" +name = "ocaml-interop" +version = "0.8.8" +source = "git+https://github.com/sebastiencs/ocaml-interop.git?branch=closure-values#f9ecf016e725589a402f3d61e120d96b8284d506" dependencies = [ - "anyhow", - "ark-ff", - "aws-config", - "aws-sdk-s3", - "binprot", - "binprot_derive", - "bitflags 2.8.0", - "gloo-timers", - "gloo-utils", - "google-cloud-auth", - "google-cloud-storage", - "jsonpath-rust", - "libp2p-identity", - "mina-p2p-messages", - "mina-signer", - "mina-tree", - "mio 1.0.3", - "node", - "openmina-core", - "rand", - "rayon", - "redux", - "reqwest 0.12.12", - "rsa", - "serde", - "serde_json", - "sha3", - "thiserror 1.0.60", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "tracing-wasm", - "vrf", - "wasm-bindgen", - "wasm-bindgen-futures", + "ocaml-boxroot-sys", + "ocaml-sys", + "static_assertions", ] [[package]] -name = "openmina-node-invariants" -version = "0.16.0" +name = "ocaml-sys" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ec6ca7d41458442627435afb8f4671e83fd642e8a560171d671a1f679aa3cf" dependencies = [ - "documented", - "lazy_static", - "node", - "redux", - "serde", - "serde_json", - "strum 0.26.2", - "strum_macros 0.26.4", + "cty", ] [[package]] -name = "openmina-node-native" -version = "0.16.0" +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "anyhow", - "bs58 0.4.0", - "bytes", - "dataloader", - "derive_more", - "getrandom", - "hex", - "jsonpath-rust", - "juniper", - "juniper_warp", - "libp2p-identity", - "mina-p2p-messages", - "mina-signer", - "mina-tree", - "nix 0.26.4", - "node", - "o1-utils", - "openmina-core", - "openmina-node-common", - "openmina-producer-dashboard", - "rand", - "rayon", - "redux", - "reqwest 0.11.24", - "serde", - "serde_json", - "sha3", - "strum 0.26.2", - "strum_macros 0.26.4", - "thiserror 1.0.60", - "tokio", - "tracing", - "tracing-subscriber", - "vrf", - "warp", + "asn1-rs 0.5.2", ] [[package]] -name = "openmina-node-testing" -version = "0.16.0" +name = "oid-registry" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "anyhow", - "axum", - "base64 0.22.0", - "bs58 0.4.0", - "clap 4.5.20", - "console", - "ctrlc", - "derive_more", - "documented", - "hex", - "lazy_static", - "libp2p", - "libp2p-identity", - "mina-p2p-messages", - "mina-tree", - "multiaddr", - "multihash 0.18.1", - "nix 0.27.1", - "node", - "num_cpus", - "openmina-core", - "openmina-node-invariants", - "openmina-node-native", - "postcard", - "rand", - "rayon", - "redux", - "reqwest 0.11.24", - "serde", - "serde_json", - "strum 0.26.2", - "strum_macros 0.26.4", - "temp-dir", - "thiserror 1.0.60", - "time", - "tokio", - "tower-http", - "tracing", - "tracing-log", - "vrf", + "asn1-rs 0.6.2", ] [[package]] -name = "openmina-node-web" -version = "0.16.0" -dependencies = [ - "anyhow", - "bytes", - "console_error_panic_hook", - "derive_more", - "gloo-utils", - "js-sys", - "jsonpath-rust", - "libp2p-identity", - "mina-p2p-messages", - "mina-signer", - "mina-tree", - "node", - "openmina-node-common", - "rand", - "rayon", - "redux", - "serde", - "serde_json", - "thiserror 1.0.60", - "vrf", - "wasm-bindgen", - "wasm-bindgen-futures", -] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "openmina-producer-dashboard" -version = "0.16.0" -dependencies = [ - "bincode", - "clap 4.5.20", - "dotenvy", - "graphql_client", - "mina-p2p-messages", - "num-bigint", - "num-traits", - "openmina-node-account", - "reqwest 0.11.24", - "serde", - "serde_json", - "sled", - "sqlx", - "thiserror 1.0.60", - "time", - "tokio", - "vrf", - "warp", -] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" @@ -6405,13 +6405,13 @@ dependencies = [ "libc", "libp2p-identity", "local-ip-address", + "mina-core", + "mina-fuzzer", + "mina-macros", "mina-p2p-messages", "mio 1.0.3", "multiaddr", "multihash 0.18.1", - "openmina-core", - "openmina-fuzzer", - "openmina-macros", "p2p-testing", "prost 0.12.4", "prost-build", @@ -6451,8 +6451,8 @@ dependencies = [ "libp2p", "libp2p-identity", "libp2p-rpc-behaviour", + "mina-core", "mina-p2p-messages", - "openmina-core", "p2p", "pin-project-lite", "rand", @@ -7514,9 +7514,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" name = "replay_dynamic_effects" version = "0.16.0" dependencies = [ + "mina-node-invariants", + "mina-node-native", "node", - "openmina-node-invariants", - "openmina-node-native", ] [[package]] @@ -8557,6 +8557,7 @@ dependencies = [ "hex", "kimchi", "linkme", + "mina-core", "mina-curves", "mina-hasher", "mina-p2p-messages", @@ -8566,7 +8567,6 @@ dependencies = [ "num-bigint", "o1-utils", "once_cell", - "openmina-core", "poly-commitment", "poseidon", "rand", @@ -9705,6 +9705,7 @@ dependencies = [ "itertools 0.12.0", "leb128", "md5", + "mina-core", "mina-curves", "mina-hasher", "mina-p2p-messages", @@ -9714,7 +9715,6 @@ dependencies = [ "num-bigint", "object 0.37.1", "once_cell", - "openmina-core", "poseidon", "rand", "ring_buffer", @@ -10091,12 +10091,12 @@ dependencies = [ "itertools 0.12.0", "mina-curves", "mina-hasher", + "mina-node-account", "mina-p2p-messages", "mina-signer", "mina-tree", "num", "o1-utils", - "openmina-node-account", "poseidon", "rand", "redux", diff --git a/Cargo.toml b/Cargo.toml index 33c5dba49c..89734ba236 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ poly-commitment = { git = "https://github.com/openmina/proof-systems", rev = "f4 juniper = { version = "0.16" } libp2p = { git = "https://github.com/openmina/rust-libp2p", rev = "5c44c7d9", default-features = false } linkme = "0.3.22" -openmina-node-account = { path = "node/account" } +mina-node-account = { path = "node/account" } redux = { git = "https://github.com/openmina/redux-rs.git", rev = "ab14890c", features = [ "serde", ] } @@ -78,7 +78,7 @@ ark-ff = { version = "0.3.0", features = ["parallel", "asm", "std"] } graphannis-malloc_size_of = { git = "https://github.com/openmina/graphannis-malloc_size_of.git", rev = "f7da9f6" } graphannis-malloc_size_of_derive = { git = "https://github.com/openmina/graphannis-malloc_size_of_derive.git" } -openmina-producer-dashboard = { path = "producer-dashboard" } +mina-producer-dashboard = { path = "producer-dashboard" } [profile.fuzz] inherits = "release" diff --git a/Dockerfile b/Dockerfile index d91ce80feb..8bfc0582d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,12 +18,12 @@ COPY . . RUN make build-release && \ mkdir -p /openmina/release-bin && \ - cp /openmina/target/release/openmina /openmina/release-bin/openmina + cp /openmina/target/release/mina /openmina/release-bin/mina RUN make build-testing && \ mkdir -p /openmina/testing-release-bin && \ - cp /openmina/target/release/openmina-node-testing \ - /openmina/testing-release-bin/openmina-node-testing + cp /openmina/target/release/mina-node-testing \ + /openmina/testing-release-bin/mina-node-testing # necessary for proof generation when running a block producer. RUN make download-circuits && \ @@ -37,8 +37,8 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -COPY --from=build /openmina/release-bin/openmina /usr/local/bin/ -COPY --from=build /openmina/testing-release-bin/openmina-node-testing \ +COPY --from=build /openmina/release-bin/mina /usr/local/bin/ +COPY --from=build /openmina/testing-release-bin/mina-node-testing \ /usr/local/bin/ RUN mkdir -p /usr/local/lib/openmina/circuit-blobs @@ -48,4 +48,4 @@ COPY --from=build /openmina/circuit-blobs/ \ EXPOSE 3000 EXPOSE 8302 -ENTRYPOINT [ "openmina" ] +ENTRYPOINT [ "mina" ] diff --git a/Makefile b/Makefile index 54e084f3a0..307643a05d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# OpenMina Makefile +# Mina Makefile # Rust NIGHTLY_RUST_VERSION = "nightly" @@ -15,10 +15,10 @@ PG_HOST ?= localhost PG_PORT ?= 5432 # Block producer configuration -PRODUCER_KEY_FILENAME ?= ./openmina-workdir/producer-key +PRODUCER_KEY_FILENAME ?= ./mina-workdir/producer-key COINBASE_RECEIVER ?= -OPENMINA_LIBP2P_EXTERNAL_IP ?= -OPENMINA_LIBP2P_PORT ?= 8302 +MINA_LIBP2P_EXTERNAL_IP ?= +MINA_LIBP2P_PORT ?= 8302 # Utilities NETWORK ?= devnet @@ -39,20 +39,20 @@ build-ledger: download-circuits ## Build the ledger binary and library, requires .PHONY: build-release build-release: ## Build the project in release mode - @cargo build --release --package=cli --bin openmina + @cargo build --release --package=cli --bin mina .PHONY: build-testing build-testing: ## Build the testing binary with scenario generators - cargo build --release --features scenario-generators --bin openmina-node-testing + cargo build --release --features scenario-generators --bin mina-node-testing .PHONY: build-tests build-tests: ## Build tests for scenario testing @mkdir -p target/release/tests @cargo build --release --tests \ - --package=openmina-node-testing \ + --package=mina-node-testing \ --package=cli @cargo build --release --tests \ - --package=openmina-node-testing \ + --package=mina-node-testing \ --package=cli \ --message-format=json > cargo-build-test.json @jq -r '. | select(.executable != null and (.target.kind | (contains(["test"])))) | [.target.name, .executable ] | @tsv' \ @@ -65,12 +65,12 @@ build-tests: ## Build tests for scenario testing build-tests-webrtc: ## Build tests for WebRTC @mkdir -p target/release/tests @cargo build --release --tests \ - --package=openmina-node-testing \ + --package=mina-node-testing \ --package=cli # Update ./.gitignore accordingly if cargo-build-test.json is changed @cargo build --release \ --features=scenario-generators,p2p-webrtc \ - --package=openmina-node-testing \ + --package=mina-node-testing \ --tests \ --message-format=json \ > cargo-build-test.json @@ -91,7 +91,7 @@ build-wasm: ## Build WebAssembly node # Update ./.gitignore accordingly if the out-dir is changed @wasm-bindgen --keep-debug --web \ --out-dir pkg \ - target/wasm32-unknown-unknown/release/openmina_node_web.wasm + target/wasm32-unknown-unknown/release/mina_node_web.wasm .PHONY: check check: ## Check code for compilation errors @@ -275,8 +275,8 @@ nextest-vrf: ## Run VRF tests with cargo-nextest, requires nightly Rust .PHONY: docker-build-all docker-build-all: docker-build-bootstrap-sandbox docker-build-debugger \ docker-build-frontend docker-build-fuzzing docker-build-heartbeats-processor \ - docker-build-light docker-build-light-focal docker-build-openmina \ - docker-build-openmina-testing docker-build-producer-dashboard \ + docker-build-light docker-build-light-focal docker-build-mina \ + docker-build-mina-testing docker-build-producer-dashboard \ docker-build-test ## Build all Docker images .PHONY: docker-build-bootstrap-sandbox @@ -312,14 +312,14 @@ docker-build-light-focal: ## Build light focal Docker image docker build -t $(DOCKER_ORG)/openmina-light-focal:$(GIT_COMMIT) \ -f node/testing/docker/Dockerfile.light.focal node/testing/docker/ -.PHONY: docker-build-openmina -docker-build-openmina: ## Build main OpenMina Docker image +.PHONY: docker-build-mina +docker-build-mina: ## Build main Mina Docker image docker build -t $(DOCKER_ORG)/openmina:$(GIT_COMMIT) . -.PHONY: docker-build-openmina-testing -docker-build-openmina-testing: ## Build OpenMina testing Docker image +.PHONY: docker-build-mina-testing +docker-build-mina-testing: ## Build Mina testing Docker image docker build -t $(DOCKER_ORG)/openmina-testing:$(GIT_COMMIT) \ - -f node/testing/docker/Dockerfile.openmina node/testing/docker/ + -f node/testing/docker/Dockerfile.mina node/testing/docker/ .PHONY: docker-build-producer-dashboard docker-build-producer-dashboard: ## Build producer dashboard Docker image @@ -334,13 +334,13 @@ docker-build-test: ## Build test Docker image # Node running targets .PHONY: run-node run-node: build-release ## Run a basic node (NETWORK=devnet, VERBOSITY=info) - @cargo run --release --package=cli --bin openmina -- node --network $(NETWORK) --verbosity $(VERBOSITY) + @cargo run --release --package=cli --bin mina -- node --network $(NETWORK) --verbosity $(VERBOSITY) # Postgres related targets + archive node .PHONY: run-archive run-archive: build-release ## Run an archive node with local storage - OPENMINA_ARCHIVE_ADDRESS=$(OPENMINA_ARCHIVE_ADDRESS) \ - cargo run --bin openmina \ + MINA_ARCHIVE_ADDRESS=$(MINA_ARCHIVE_ADDRESS) \ + cargo run --bin mina \ --release -- \ node \ --archive-archiver-process \ @@ -355,14 +355,14 @@ run-block-producer: build-release ## Run a block producer node on $(NETWORK) net exit 1; \ fi cargo run \ - --bin openmina \ + --bin mina \ --package=cli \ --release -- \ node \ --producer-key $(PRODUCER_KEY_FILENAME) \ $(if $(COINBASE_RECEIVER),--coinbase-receiver $(COINBASE_RECEIVER)) \ - $(if $(OPENMINA_LIBP2P_EXTERNAL_IP),--libp2p-external-ip $(OPENMINA_LIBP2P_EXTERNAL_IP)) \ - $(if $(OPENMINA_LIBP2P_PORT),--libp2p-port $(OPENMINA_LIBP2P_PORT)) \ + $(if $(MINA_LIBP2P_EXTERNAL_IP),--libp2p-external-ip $(MINA_LIBP2P_EXTERNAL_IP)) \ + $(if $(MINA_LIBP2P_PORT),--libp2p-port $(MINA_LIBP2P_PORT)) \ --network $(NETWORK) @@ -377,9 +377,9 @@ generate-block-producer-key: build-release ## Generate a new block producer key echo "Or remove the existing key first to regenerate it."; \ exit 1; \ fi - @mkdir -p openmina-workdir + @mkdir -p mina-workdir @echo "Generating new encrypted block producer key..." - @OUTPUT=$$($(if $(MINA_PRIVKEY_PASS),MINA_PRIVKEY_PASS="$(MINA_PRIVKEY_PASS)") cargo run --release --package=cli --bin openmina -- misc mina-encrypted-key --file $(PRODUCER_KEY_FILENAME)); \ + @OUTPUT=$$($(if $(MINA_PRIVKEY_PASS),MINA_PRIVKEY_PASS="$(MINA_PRIVKEY_PASS)") cargo run --release --package=cli --bin mina -- misc mina-encrypted-key --file $(PRODUCER_KEY_FILENAME)); \ PUBLIC_KEY=$$(echo "$$OUTPUT" | grep "public key:" | cut -d' ' -f3); \ chmod 600 $(PRODUCER_KEY_FILENAME); \ echo ""; \ diff --git a/README.md b/README.md index 1c525f84de..301f749e66 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,17 @@ network connectivity, block production, SNARK generation, and debugging tools. This repository contains the complete Mina Rust Node implementation: -- **[node/](node)** - Core node business logic and state machine -- **[p2p/](p2p)** - Networking layer (libp2p + WebRTC) -- **[ledger/](ledger)** - Ledger implementation and transaction processing -- **[snark/](snark)** - SNARK proof verification -- **[cli/](cli)** - Command-line interface -- **[frontend/](frontend)** - Web-based node dashboard +- [core/](core) - Provides basic types needed to be shared across different + components of the node. +- [ledger/](ledger) - Mina ledger implementation in Rust. +- [snark/](snark) - Snark/Proof verification. +- [p2p/](p2p) - P2p implementation for Mina node. +- [node/](node) - Combines all the business logic of the node. + - [native/](node/native) - OS specific pieces of the node, which is used to + run the node natively (Linux/Mac/Windows). + - [testing/](node/testing) - Testing framework for Mina node. +- [cli/](cli) - Mina CLI. +- [frontend/](frontend) - OpenMina frontend. **[Learn more about the architecture →](https://o1-labs.github.io/openmina/docs/developers/getting-started)** diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 7cd011b85a..71544bdde0 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "Apache-2.0" [[bin]] -name = "openmina" +name = "mina" path = "src/main.rs" [dependencies] @@ -31,11 +31,11 @@ time = { version = "0.3", features = ["formatting", "macros", "parsing"] } backtrace = "0.3" bytes = "1.4.0" dialoguer = "0.10.4" +mina-core = { path = "../core" } +mina-node-account = { path = "../node/account" } +mina-node-native = { path = "../node/native" } nix = { version = "0.26.2", features = ["signal"] } node = { path = "../node", features = ["replay"] } -openmina-core = { path = "../core" } -openmina-node-account = { path = "../node/account" } -openmina-node-native = { path = "../node/native" } serde_json = "1.0.107" shellexpand = "3.1.0" tracing = "0.1.37" @@ -50,6 +50,6 @@ tempfile = "3.8.0" [features] default = ["p2p-libp2p", "p2p-webrtc"] unsafe-signal-handlers = [] -p2p-libp2p = ["openmina-node-native/p2p-libp2p"] -p2p-webrtc = ["openmina-node-native/p2p-webrtc"] -fuzzing = ["node/fuzzing", "openmina-core/fuzzing"] +p2p-libp2p = ["mina-node-native/p2p-libp2p"] +p2p-webrtc = ["mina-node-native/p2p-webrtc"] +fuzzing = ["node/fuzzing", "mina-core/fuzzing"] diff --git a/cli/replay_dynamic_effects/Cargo.toml b/cli/replay_dynamic_effects/Cargo.toml index e64ed843b2..fb52c5d5e0 100644 --- a/cli/replay_dynamic_effects/Cargo.toml +++ b/cli/replay_dynamic_effects/Cargo.toml @@ -9,6 +9,6 @@ crate-type = ["dylib"] name = "replay_dynamic_effects" [dependencies] +mina-node-invariants = { path = "../../node/invariants" } +mina-node-native = { path = "../../node/native" } node = { path = "../../node", features = ["replay"] } -openmina-node-invariants = { path = "../../node/invariants" } -openmina-node-native = { path = "../../node/native" } diff --git a/cli/replay_dynamic_effects/src/lib.rs b/cli/replay_dynamic_effects/src/lib.rs index f788b95c75..030f4e2905 100644 --- a/cli/replay_dynamic_effects/src/lib.rs +++ b/cli/replay_dynamic_effects/src/lib.rs @@ -1,6 +1,6 @@ use ::node::{ActionWithMeta, Store}; -use openmina_node_invariants::{InvariantIgnoreReason, InvariantResult, Invariants}; -use openmina_node_native::NodeService; +use mina_node_invariants::{InvariantIgnoreReason, InvariantResult, Invariants}; +use mina_node_native::NodeService; pub mod ret { macro_rules! define { diff --git a/cli/src/commands/build_info/mod.rs b/cli/src/commands/build_info/mod.rs index 3e7e52ba3f..6bc69b846f 100644 --- a/cli/src/commands/build_info/mod.rs +++ b/cli/src/commands/build_info/mod.rs @@ -1,6 +1,6 @@ use node::BuildEnv; -/// Displays openmina version, commit etc. +/// Displays mina version, commit etc. #[derive(Debug, clap::Args)] pub struct Command; diff --git a/cli/src/commands/misc.rs b/cli/src/commands/misc.rs index b7c84b9e5e..4308f4db6e 100644 --- a/cli/src/commands/misc.rs +++ b/cli/src/commands/misc.rs @@ -27,7 +27,7 @@ pub enum MiscCommand { #[derive(Debug, Clone, clap::Args)] pub struct P2PKeyPair { - #[arg(long, short = 's', env = "OPENMINA_P2P_SEC_KEY")] + #[arg(long, short = 's', env = "MINA_P2P_SEC_KEY")] p2p_secret_key: Option, } @@ -48,7 +48,7 @@ impl P2PKeyPair { #[derive(Debug, Clone, clap::Args)] pub struct MinaKeyPair { - #[arg(long, short = 's', env = "OPENMINA_SEC_KEY")] + #[arg(long, short = 's', env = "MINA_SEC_KEY")] secret_key: Option, } @@ -77,23 +77,23 @@ impl MinaKeyPair { /// /// Generate a new encrypted key with password: /// ```bash -/// openmina misc mina-encrypted-key --password mypassword --file producer-key +/// mina misc mina-encrypted-key --password mypassword --file producer-key /// ``` /// /// Generate a new encrypted key using environment variable for password: /// ```bash -/// MINA_PRIVKEY_PASS=mypassword openmina misc mina-encrypted-key --file producer-key +/// MINA_PRIVKEY_PASS=mypassword mina misc mina-encrypted-key --file producer-key /// ``` /// /// Use an existing secret key: /// ```bash -/// openmina misc mina-encrypted-key --secret-key EKE... --password mypassword +/// mina misc mina-encrypted-key --secret-key EKE... --password mypassword /// ``` #[derive(Debug, Clone, clap::Args)] pub struct MinaEncryptedKey { /// Optional existing secret key to encrypt. If not provided, generates a /// new random key - #[arg(long, short = 's', env = "OPENMINA_ENC_KEY")] + #[arg(long, short = 's', env = "MINA_ENC_KEY")] secret_key: Option, /// Password to encrypt the key file with. Can be provided via diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index a1a0b92fcf..1909c87f21 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -5,14 +5,14 @@ pub mod replay; pub mod snark; #[derive(Debug, clap::Parser)] -#[command(name = "openmina", about = "Openmina Cli")] -pub struct OpenminaCli { +#[command(name = "mina", about = "Mina Cli")] +pub struct MinaCli { #[arg( global = true, long, value_enum, default_value_t = Network::Devnet, - env = "OPENMINA_NETWORK" + env = "MINA_NETWORK" )] /// Select the network (devnet or mainnet) pub network: Network, diff --git a/cli/src/commands/node/mod.rs b/cli/src/commands/node/mod.rs index c240ef825a..ea3d2bf3da 100644 --- a/cli/src/commands/node/mod.rs +++ b/cli/src/commands/node/mod.rs @@ -8,7 +8,7 @@ use node::{ transition_frontier::genesis::GenesisConfig, }; -use openmina_node_account::AccountPublicKey; +use mina_node_account::AccountPublicKey; use reqwest::Url; use node::{ @@ -18,11 +18,11 @@ use node::{ SnarkerStrategy, }; -use openmina_node_native::{archive::config::ArchiveStorageOptions, tracing, NodeBuilder}; +use mina_node_native::{archive::config::ArchiveStorageOptions, tracing, NodeBuilder}; -/// OpenMina node configuration and runtime options +/// Mina node configuration and runtime options /// -/// This struct defines all available command-line parameters for running an OpenMina node. +/// This struct defines all available command-line parameters for running a Mina node. /// The node can operate in different modes (basic node, block producer, archive node) /// depending on the parameters provided. /// @@ -30,52 +30,47 @@ use openmina_node_native::{archive::config::ArchiveStorageOptions, tracing, Node /// /// ```bash /// # Run a basic node on devnet -/// openmina node --network devnet +/// mina node --network devnet /// /// # Run with custom ports and logging -/// openmina node --network devnet --port 3001 --libp2p-port 8303 --verbosity debug +/// mina node --network devnet --port 3001 --libp2p-port 8303 --verbosity debug /// ``` /// /// # Block Producer Mode /// /// ```bash /// # Run as block producer -/// openmina node --network devnet --producer-key /path/to/key --coinbase-receiver B62q... +/// mina node --network devnet --producer-key /path/to/key --coinbase-receiver B62q... /// ``` /// /// # Archive Node Mode /// /// ```bash /// # Run as archive node with local storage -/// openmina node --network devnet --archive-local-storage +/// mina node --network devnet --archive-local-storage /// ``` #[derive(Debug, clap::Args)] pub struct Node { /// Working directory for node data, logs, and configuration files /// - /// Can be set via OPENMINA_HOME environment variable. - /// Defaults to ~/.openmina - #[arg( - long, - short = 'd', - default_value = "~/.openmina", - env = "OPENMINA_HOME" - )] + /// Can be set via MINA_HOME environment variable. + /// Defaults to ~/.mina + #[arg(long, short = 'd', default_value = "~/.mina", env = "MINA_HOME")] pub work_dir: String, /// P2P networking secret key for node identity /// /// If not provided, a new key will be generated automatically. - /// Can be set via OPENMINA_P2P_SEC_KEY environment variable. - #[arg(long, short = 's', env = "OPENMINA_P2P_SEC_KEY")] + /// Can be set via MINA_P2P_SEC_KEY environment variable. + #[arg(long, short = 's', env = "MINA_P2P_SEC_KEY")] pub p2p_secret_key: Option, - // warning, this overrides `OPENMINA_P2P_SEC_KEY` + // warning, this overrides `MINA_P2P_SEC_KEY` /// Compatibility with OCaml Mina node #[arg(long)] pub libp2p_keypair: Option, - // warning, this overrides `OPENMINA_P2P_SEC_KEY` + // warning, this overrides `MINA_P2P_SEC_KEY` /// Compatibility with OCaml Mina node #[arg(env = "MINA_LIBP2P_PASS")] pub libp2p_password: Option, @@ -110,15 +105,11 @@ pub struct Node { pub verbosity: Level, /// Disable filesystem logging - #[arg( - long, - env = "OPENMINA_DISABLE_FILESYSTEM_LOGGING", - default_value_t = false - )] + #[arg(long, env = "MINA_DISABLE_FILESYSTEM_LOGGING", default_value_t = false)] pub disable_filesystem_logging: bool, /// Specify custom path for log files - #[arg(long, env = "OPENMINA_LOG_PATH", default_value = "$OPENMINA_HOME")] + #[arg(long, env = "MINA_LOG_PATH", default_value = "$MINA_HOME")] pub log_path: String, /// Initial peers to connect to on startup @@ -148,7 +139,7 @@ pub struct Node { /// Where: /// - `ip4/ip6/dns4` specifies the address type /// - IP address or hostname - /// - `tcp` protocol with port number (typically 8302 for OpenMina) + /// - `tcp` protocol with port number (typically 8302 for Mina) /// - `p2p` protocol with the peer's public key identifier #[arg(long, short = 'P', alias = "peer")] pub peers: Vec, @@ -240,14 +231,14 @@ pub struct Node { /// Enable local precomputed storage. /// /// This option requires the following environment variables to be set: - /// - OPENMINA_ARCHIVE_LOCAL_STORAGE_PATH (otherwise the path to the working directory will be used) + /// - MINA_ARCHIVE_LOCAL_STORAGE_PATH (otherwise the path to the working directory will be used) #[arg(long, env)] pub archive_local_storage: bool, /// Enable archiver process. /// /// This requires the following environment variables to be set: - /// - OPENMINA_ARCHIVE_ADDRESS + /// - MINA_ARCHIVE_ADDRESS #[arg(long, env)] pub archive_archiver_process: bool, @@ -267,7 +258,7 @@ pub struct Node { /// - AWS_SECRET_ACCESS_KEY /// - AWS_SESSION_TOKEN /// - AWS_DEFAULT_REGION - /// - OPENMINA_AWS_BUCKET_NAME + /// - MINA_AWS_BUCKET_NAME #[arg(long, env)] pub archive_aws_storage: bool, @@ -280,7 +271,7 @@ impl Node { let work_dir = shellexpand::full(&self.work_dir).unwrap().into_owned(); let _guard = if !self.disable_filesystem_logging { - let log_output_dir = if self.log_path == "$OPENMINA_HOME" { + let log_output_dir = if self.log_path == "$MINA_HOME" { work_dir.clone() } else { self.log_path.clone() @@ -296,7 +287,7 @@ impl Node { rayon::ThreadPoolBuilder::new() .num_threads(num_cpus::get().max(2) - 1) - .thread_name(|i| format!("openmina_rayon_{i}")) + .thread_name(|i| format!("mina_rayon_{i}")) .build_global() .context("failed to initialize threadpool")?; @@ -350,7 +341,7 @@ impl Node { node_builder.p2p_sec_key(sec_key); } - // warning, this overrides `OPENMINA_P2P_SEC_KEY` + // warning, this overrides `MINA_P2P_SEC_KEY` if let (Some(key_file), Some(password)) = (&self.libp2p_keypair, &self.libp2p_password) { match SecretKey::from_encrypted_file(key_file, password) { Ok(sk) => { @@ -410,7 +401,7 @@ impl Node { if let Some(producer_key_path) = self.producer_key { let password = &self.producer_key_password; - openmina_core::thread::spawn(|| { + mina_core::thread::spawn(|| { node::core::info!(node::core::log::system_time(); summary = "loading provers index"); BlockProver::make(Some(block_verifier_index), Some(work_verifier_index)); node::core::info!(node::core::log::system_time(); summary = "loaded provers index"); @@ -468,7 +459,7 @@ impl Node { node_builder.snarker(sec_key, self.snarker_fee, self.snarker_strategy); } - openmina_core::set_work_dir(work_dir.clone().into()); + mina_core::set_work_dir(work_dir.clone().into()); node_builder .http_server(self.port) diff --git a/cli/src/commands/replay/replay_state_with_input_actions.rs b/cli/src/commands/replay/replay_state_with_input_actions.rs index d5271eaa81..2fdb527c75 100644 --- a/cli/src/commands/replay/replay_state_with_input_actions.rs +++ b/cli/src/commands/replay/replay_state_with_input_actions.rs @@ -1,10 +1,10 @@ +use mina_node_native::replay_state_with_input_actions; use node::BuildEnv; -use openmina_node_native::replay_state_with_input_actions; #[derive(Debug, clap::Args)] /// Replay node using initial state and input actions. pub struct ReplayStateWithInputActions { - #[arg(long, short, default_value = "~/.openmina/recorder")] + #[arg(long, short, default_value = "~/.mina/recorder")] pub dir: String, #[arg(long, default_value = "./target/release/libreplay_dynamic_effects.so")] @@ -20,7 +20,7 @@ pub struct ReplayStateWithInputActions { impl ReplayStateWithInputActions { pub fn run(self) -> anyhow::Result<()> { - openmina_node_native::tracing::initialize(self.verbosity); + mina_node_native::tracing::initialize(self.verbosity); let dir = shellexpand::full(&self.dir)?.into_owned(); let dynamic_effects_lib = shellexpand::full(&self.dynamic_effects_lib)?.into_owned(); diff --git a/cli/src/main.rs b/cli/src/main.rs index 1bad29048d..406e31bf8e 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -127,11 +127,11 @@ fn main() -> anyhow::Result<()> { #[cfg(feature = "unsafe-signal-handlers")] unsafe_signal_handlers::setup(); - let app = commands::OpenminaCli::parse(); + let app = commands::MinaCli::parse(); let network_init_result = match app.network { - commands::Network::Devnet => openmina_core::NetworkConfig::init("devnet"), - commands::Network::Mainnet => openmina_core::NetworkConfig::init("mainnet"), + commands::Network::Devnet => mina_core::NetworkConfig::init("devnet"), + commands::Network::Mainnet => mina_core::NetworkConfig::init("mainnet"), }; network_init_result.expect("Failed to initialize network configuration"); diff --git a/cli/tests/bootstrap.rs b/cli/tests/bootstrap.rs index fecedbce8e..c2d5281ecb 100644 --- a/cli/tests/bootstrap.rs +++ b/cli/tests/bootstrap.rs @@ -8,8 +8,8 @@ use std::{ }; use clap::Parser; +use mina_core::log::system_time; use node::stats::sync::{SyncSnarkedLedger, SyncStagedLedger, SyncStatsSnapshot}; -use openmina_core::log::system_time; use redux::Timestamp; #[test] @@ -19,10 +19,10 @@ fn bootstrap() -> anyhow::Result<()> { Ok(()) } -const FORK_VAR: &str = "OPENMINA_BOOTSTRAP_FORK"; +const FORK_VAR: &str = "MINA_BOOTSTRAP_FORK"; const HTTP_PORT: u16 = 49998; const P2P_PORT: u16 = 49999; -const COMMAND_VAR: &str = "OPENMINA_COMMAND"; +const COMMAND_VAR: &str = "MINA_COMMAND"; fn spawn_node() -> anyhow::Result { if std::env::var(FORK_VAR).is_ok() { @@ -34,12 +34,10 @@ fn spawn_node() -> anyhow::Result { } fn run_node() -> anyhow::Result<()> { - if let Err(e) = cli::commands::OpenminaCli::parse_from([ - std::env::args().next().unwrap(), - String::from("node"), - ]) - .command - .run() + if let Err(e) = + cli::commands::MinaCli::parse_from([std::env::args().next().unwrap(), String::from("node")]) + .command + .run() { anyhow::bail!(format!("{e:#}")); } diff --git a/core/Cargo.toml b/core/Cargo.toml index 0e50c6895d..ce45ca53a0 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-core" +name = "mina-core" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -14,10 +14,10 @@ crypto_secretbox = { version = "0.1.1", features = ["std"] } flume = { version = "0.11.1", features = ["async", "spin"] } lazy_static = "1.4.0" md5 = "0.7.0" +mina-fuzzer = { path = "../fuzzer", optional = true } +mina-macros = { path = "../macros" } multihash = { version = "0.18.1", features = ["blake2b"] } once_cell = "1" -openmina-fuzzer = { path = "../fuzzer", optional = true } -openmina-macros = { path = "../macros" } rand = "0.8.0" redux = { workspace = true } serde = { version = "1.0.147", features = ["rc"] } @@ -54,4 +54,4 @@ web-sys = { version = "0.3", features = ["Window", "Response"] } serde_json = { version = "1" } [features] -fuzzing = ["openmina-fuzzer"] +fuzzing = ["mina-fuzzer"] diff --git a/core/src/chain_id.rs b/core/src/chain_id.rs index 646491226b..8f80e2562e 100644 --- a/core/src/chain_id.rs +++ b/core/src/chain_id.rs @@ -33,7 +33,7 @@ //! //! ## Network Identifiers //! -//! OpenMina includes predefined chain IDs for official networks: +//! Mina includes predefined chain IDs for official networks: //! //! - [`MAINNET_CHAIN_ID`]: The production Mina blockchain //! - [`DEVNET_CHAIN_ID`]: The development/testing blockchain @@ -42,7 +42,7 @@ //! //! ## Usage in Networking //! -//! Chain IDs are used throughout OpenMina's networking stack: +//! Chain IDs are used throughout Mina's networking stack: //! //! - **Peer Discovery**: Nodes advertise their chain ID to find compatible //! peers @@ -54,10 +54,10 @@ //! ## Example //! //! ```rust -//! use openmina_core::ChainId; +//! use mina_core::ChainId; //! //! // Use predefined network -//! let mainnet_id = openmina_core::MAINNET_CHAIN_ID; +//! let mainnet_id = mina_core::MAINNET_CHAIN_ID; //! println!("Mainnet ID: {}", mainnet_id); //! //! // Parse from hex string @@ -133,7 +133,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; /// ## Example Usage /// /// ```rust -/// use openmina_core::{ChainId, MAINNET_CHAIN_ID}; +/// use mina_core::{ChainId, MAINNET_CHAIN_ID}; /// /// // Use predefined mainnet ID /// let mainnet = MAINNET_CHAIN_ID; @@ -218,7 +218,7 @@ impl ChainId { /// # Example /// /// ```rust - /// use openmina_core::ChainId; + /// use mina_core::ChainId; /// use mina_p2p_messages::v2::UnsignedExtendedUInt32StableV1; /// /// let chain_id = ChainId::compute( @@ -284,7 +284,7 @@ impl ChainId { /// # Example /// /// ```rust - /// use openmina_core::MAINNET_CHAIN_ID; + /// use mina_core::MAINNET_CHAIN_ID; /// /// let psk = MAINNET_CHAIN_ID.preshared_key(); /// // Use psk to configure libp2p Pnet transport @@ -312,7 +312,7 @@ impl ChainId { /// # Example /// /// ```rust - /// use openmina_core::MAINNET_CHAIN_ID; + /// use mina_core::MAINNET_CHAIN_ID; /// /// let hex_id = MAINNET_CHAIN_ID.to_hex(); /// assert_eq!(hex_id.len(), 64); @@ -347,7 +347,7 @@ impl ChainId { /// # Example /// /// ```rust - /// use openmina_core::ChainId; + /// use mina_core::ChainId; /// /// let chain_id = ChainId::from_hex( /// "a7351abc7ddf2ea92d1b38cc8e636c271c1dfd2c081c637f62ebc2af34eb7cc1" @@ -382,7 +382,7 @@ impl ChainId { /// # Example /// /// ```rust - /// use openmina_core::ChainId; + /// use mina_core::ChainId; /// /// let bytes = [0u8; 32]; // All zeros for testing /// let chain_id = ChainId::from_bytes(&bytes); @@ -464,7 +464,7 @@ impl Debug for ChainId { /// # Usage /// /// ```rust -/// use openmina_core::DEVNET_CHAIN_ID; +/// use mina_core::DEVNET_CHAIN_ID; /// /// println!("Devnet ID: {}", DEVNET_CHAIN_ID.to_hex()); /// let psk = DEVNET_CHAIN_ID.preshared_key(); @@ -497,7 +497,7 @@ pub const DEVNET_CHAIN_ID: ChainId = ChainId([ /// # Usage /// /// ```rust -/// use openmina_core::MAINNET_CHAIN_ID; +/// use mina_core::MAINNET_CHAIN_ID; /// /// println!("Mainnet ID: {}", MAINNET_CHAIN_ID.to_hex()); /// let psk = MAINNET_CHAIN_ID.preshared_key(); diff --git a/core/src/encrypted_key.rs b/core/src/encrypted_key.rs index 56947e19ac..fa2b589a1c 100644 --- a/core/src/encrypted_key.rs +++ b/core/src/encrypted_key.rs @@ -1,7 +1,7 @@ //! # Encrypted Secret Key Implementation //! //! This module provides a unified interface for encrypting and decrypting -//! cryptographic secret keys used throughout the OpenMina node. It implements +//! cryptographic secret keys used throughout the Mina node. It implements //! password-based encryption compatible with the Mina Protocol's key format. //! //! ## Usage diff --git a/core/src/lib.rs b/core/src/lib.rs index 0752c471b7..7e190387b4 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -75,11 +75,11 @@ pub fn preshared_key(chain_id: &ChainId) -> [u8; 32] { } pub use log::ActionEvent; +pub use mina_macros::*; use multihash::Blake2b256; -pub use openmina_macros::*; #[cfg(feature = "fuzzing")] -pub use openmina_fuzzer::*; +pub use mina_fuzzer::*; #[macro_export] macro_rules! fuzz_maybe { diff --git a/core/src/log.rs b/core/src/log.rs index c46b40b8ba..87af4a1a05 100644 --- a/core/src/log.rs +++ b/core/src/log.rs @@ -88,7 +88,7 @@ macro_rules! error { }; } -pub const ACTION_TRACE_TARGET: &str = "openmina_core::log::action"; +pub const ACTION_TRACE_TARGET: &str = "mina_core::log::action"; #[macro_export] macro_rules! action_event { @@ -178,7 +178,7 @@ pub use crate::{debug, error, info, trace, warn}; #[macro_export] macro_rules! bug_condition { ($($arg:tt)*) => {{ - if std::env::var("OPENMINA_PANIC_ON_BUG") + if std::env::var("MINA_PANIC_ON_BUG") .map(|v| ["true", "1"].contains(&v.to_lowercase().as_str())) .unwrap_or(false) { panic!($($arg)*) diff --git a/docker-compose.block-producer.yml b/docker-compose.block-producer.yml index a738413167..b62803dbae 100644 --- a/docker-compose.block-producer.yml +++ b/docker-compose.block-producer.yml @@ -1,22 +1,22 @@ services: - openmina-node: - image: openmina/openmina:${OPENMINA_TAG:-latest} + mina-node: + image: openmina/openmina:${MINA_TAG:-latest} entrypoint: > - sh -c "openmina node --producer-key /root/.openmina/producer-key $${COINBASE_RECEIVER:+--coinbase-receiver $$COINBASE_RECEIVER} $${OPENMINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$OPENMINA_LIBP2P_EXTERNAL_IP} $${OPENMINA_LIBP2P_PORT:+--libp2p-port $$OPENMINA_LIBP2P_PORT}" + sh -c "mina node --producer-key /root/.mina/producer-key $${COINBASE_RECEIVER:+--coinbase-receiver $$COINBASE_RECEIVER} $${MINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP} $${MINA_LIBP2P_PORT:+--libp2p-port $$MINA_LIBP2P_PORT}" ports: - "3000:3000" - - "${OPENMINA_LIBP2P_PORT:-8302}:${OPENMINA_LIBP2P_PORT:-8302}" + - "${MINA_LIBP2P_PORT:-8302}:${MINA_LIBP2P_PORT:-8302}" volumes: - - ./openmina-workdir:/root/.openmina:rw + - ./mina-workdir:/root/.mina:rw environment: MINA_PRIVKEY_PASS: "${MINA_PRIVKEY_PASS:-}" COINBASE_RECEIVER: "${COINBASE_RECEIVER:-}" - OPENMINA_LIBP2P_EXTERNAL_IP: "${OPENMINA_LIBP2P_EXTERNAL_IP}" - OPENMINA_LIBP2P_PORT: "${OPENMINA_LIBP2P_PORT}" + MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP}" + MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT}" frontend: - image: openmina/frontend:${OPENMINA_FRONTEND_TAG:-latest} + image: openmina/frontend:${MINA_FRONTEND_TAG:-latest} environment: - OPENMINA_FRONTEND_ENVIRONMENT: compose-producer + MINA_FRONTEND_ENVIRONMENT: compose-producer ports: - "8070:80" diff --git a/docker-compose.yml b/docker-compose.yml index b313c0245c..6f7686446c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,20 @@ services: - openmina-node: - image: openmina/openmina:${OPENMINA_TAG:-latest} + mina-node: + image: openmina/openmina:${MINA_TAG:-latest} entrypoint: > - sh -c "openmina node $${OPENMINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$OPENMINA_LIBP2P_EXTERNAL_IP} $${OPENMINA_LIBP2P_PORT:+--libp2p-port $$OPENMINA_LIBP2P_PORT}" + sh -c "mina node $${MINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP} $${MINA_LIBP2P_PORT:+--libp2p-port $$MINA_LIBP2P_PORT}" volumes: - - ./openmina-workdir:/root/.openmina:rw + - ./mina-workdir:/root/.mina:rw ports: - "3000:3000" - - "${OPENMINA_LIBP2P_PORT:-8302}:${OPENMINA_LIBP2P_PORT:-8302}" + - "${MINA_LIBP2P_PORT:-8302}:${MINA_LIBP2P_PORT:-8302}" environment: - OPENMINA_LIBP2P_EXTERNAL_IP: "${OPENMINA_LIBP2P_EXTERNAL_IP}" - OPENMINA_LIBP2P_PORT: "${OPENMINA_LIBP2P_PORT}" + MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP}" + MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT}" frontend: - image: openmina/frontend:${OPENMINA_FRONTEND_TAG:-latest} + image: openmina/frontend:${MINA_FRONTEND_TAG:-latest} environment: - OPENMINA_FRONTEND_ENVIRONMENT: compose + MINA_FRONTEND_ENVIRONMENT: compose ports: - "8070:80" diff --git a/fuzzer/Cargo.toml b/fuzzer/Cargo.toml index 64137af55c..e801716c46 100644 --- a/fuzzer/Cargo.toml +++ b/fuzzer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-fuzzer" +name = "mina-fuzzer" version = "0.16.0" edition = "2021" license = "Apache-2.0" diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index 7401eed92b..e632287c2f 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -19,13 +19,13 @@ crate-type = ["staticlib", "cdylib", "lib"] [dependencies] juniper = { workspace = true } kimchi = { workspace = true } +mina-core = { path = "../core" } mina-curves = { workspace = true } mina-hasher = { workspace = true } +mina-macros = { path = "../macros" } mina-poseidon = { workspace = true } mina-signer = { workspace = true } o1-utils = { workspace = true } -openmina-core = { path = "../core" } -openmina-macros = { path = "../macros" } poly-commitment = { workspace = true } poseidon = { workspace = true } redux = { workspace = true } diff --git a/ledger/src/account/account.rs b/ledger/src/account/account.rs index 3a77f6f202..9ff5996622 100644 --- a/ledger/src/account/account.rs +++ b/ledger/src/account/account.rs @@ -1,6 +1,7 @@ use std::{io::Cursor, str::FromStr, sync::Arc}; use ark_ff::{BigInteger256, One, UniformRand, Zero}; +use mina_core::constants::PROTOCOL_VERSION; use mina_curves::pasta::Fp; use mina_p2p_messages::{ binprot::{BinProtRead, BinProtWrite}, @@ -8,7 +9,6 @@ use mina_p2p_messages::{ }; use mina_signer::CompressedPubKey; use once_cell::sync::{Lazy, OnceCell}; -use openmina_core::constants::PROTOCOL_VERSION; use rand::{prelude::ThreadRng, seq::SliceRandom, Rng}; use serde::{Deserialize, Serialize}; diff --git a/ledger/src/database/database.rs b/ledger/src/database/database.rs index 8d0ee7db4c..5f57f39efd 100644 --- a/ledger/src/database/database.rs +++ b/ledger/src/database/database.rs @@ -409,7 +409,7 @@ mod tests { fn test_hashing_tree_with_web_workers() { use web_sys::console; - use openmina_core::thread; + use mina_core::thread; use std::time::Duration; use crate::account; diff --git a/ledger/src/dummy/mod.rs b/ledger/src/dummy/mod.rs index 654778ab72..08ea7e2fe7 100644 --- a/ledger/src/dummy/mod.rs +++ b/ledger/src/dummy/mod.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use mina_p2p_messages::{binprot::BinProtRead, v2::PicklesProofProofsVerifiedMaxStableV2}; -pub use openmina_core::dummy::*; +pub use mina_core::dummy::*; #[cfg(any(test, feature = "fuzzing"))] use crate::VerificationKey; diff --git a/ledger/src/proofs/block.rs b/ledger/src/proofs/block.rs index d0407094ae..e45d36fa58 100644 --- a/ledger/src/proofs/block.rs +++ b/ledger/src/proofs/block.rs @@ -3,9 +3,9 @@ use std::{rc::Rc, sync::Arc}; use anyhow::Context; use ark_ff::fields::arithmetic::InvalidBigInt; use consensus::ConsensusState; +use mina_core::constants::{constraint_constants, ForkConstants}; use mina_curves::pasta::{Fp, Fq}; use mina_p2p_messages::v2; -use openmina_core::constants::{constraint_constants, ForkConstants}; use poseidon::hash::{ params::{MINA_PROTO_STATE, MINA_PROTO_STATE_BODY}, Inputs, diff --git a/ledger/src/proofs/caching.rs b/ledger/src/proofs/caching.rs index b04b018028..9bc699b282 100644 --- a/ledger/src/proofs/caching.rs +++ b/ledger/src/proofs/caching.rs @@ -482,8 +482,8 @@ where (&srs).into() } -pub fn openmina_cache_path>(path: P) -> Option { - std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".cache/openmina").join(path)) +pub fn mina_cache_path>(path: P) -> Option { + std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".cache/mina").join(path)) } pub fn ensure_path_exists + Clone>(path: P) -> Result<(), std::io::Error> { diff --git a/ledger/src/proofs/circuit_blobs.rs b/ledger/src/proofs/circuit_blobs.rs index 18558061ef..8fb6588d40 100644 --- a/ledger/src/proofs/circuit_blobs.rs +++ b/ledger/src/proofs/circuit_blobs.rs @@ -35,12 +35,7 @@ pub fn fetch_blocking(filename: &impl AsRef) -> std::io::Result> { let home_base_dir = home_base_dir(); let found = None - .or_else(|| { - try_base_dir( - std::env::var("OPENMINA_CIRCUIT_BLOBS_BASE_DIR").ok()?, - filename, - ) - }) + .or_else(|| try_base_dir(std::env::var("MINA_CIRCUIT_BLOBS_BASE_DIR").ok()?, filename)) .or_else(|| try_base_dir(env!("CARGO_MANIFEST_DIR").to_string(), filename)) .or_else(|| try_base_dir(home_base_dir.clone()?, filename)) .or_else(|| try_base_dir("/usr/local/lib/openmina/circuit-blobs", filename)); @@ -49,8 +44,8 @@ pub fn fetch_blocking(filename: &impl AsRef) -> std::io::Result> { return std::fs::read(path); } - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "ledger proofs", message = "circuit-blobs not found locally, so fetching it...", filename = filename.as_ref().to_str().unwrap(), @@ -66,8 +61,8 @@ pub fn fetch_blocking(filename: &impl AsRef) -> std::io::Result> { // cache it to home dir. let cache_path = base_dir.join(filename); - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "ledger proofs", message = "caching circuit-blobs", path = cache_path.to_str().unwrap(), @@ -83,7 +78,7 @@ pub async fn fetch(filename: &impl AsRef) -> std::io::Result> { let prefix = option_env!("CIRCUIT_BLOBS_HTTP_PREFIX").unwrap_or("/assets/webnode/circuit-blobs"); let url = format!("{prefix}/{}", filename.as_ref().to_str().unwrap()); - openmina_core::http::get_bytes(&url).await + mina_core::http::get_bytes(&url).await // http::get_bytes(&git_release_url(filename)).await } @@ -92,5 +87,5 @@ pub fn fetch_blocking(filename: &impl AsRef) -> std::io::Result> { let prefix = option_env!("CIRCUIT_BLOBS_HTTP_PREFIX").unwrap_or("/assets/webnode/circuit-blobs"); let url = format!("{prefix}/{}", filename.as_ref().to_str().unwrap()); - openmina_core::http::get_bytes_blocking(&url) + mina_core::http::get_bytes_blocking(&url) } diff --git a/ledger/src/proofs/provers.rs b/ledger/src/proofs/provers.rs index 4ce80b95ad..77e2bff026 100644 --- a/ledger/src/proofs/provers.rs +++ b/ledger/src/proofs/provers.rs @@ -1,9 +1,9 @@ use std::{collections::HashMap, path::Path, sync::Arc}; use kimchi::circuits::gate::CircuitGate; +use mina_core::network::CircuitsConfig; use mina_curves::pasta::{Fp, Fq}; use once_cell::sync::OnceCell; -use openmina_core::network::CircuitsConfig; use super::{ circuit_blobs, @@ -22,17 +22,17 @@ use mina_p2p_messages::binprot::{ }; pub fn devnet_circuit_directory() -> &'static str { - openmina_core::network::devnet::CIRCUITS_CONFIG.directory_name + mina_core::network::devnet::CIRCUITS_CONFIG.directory_name } // TODO(tizoc): right now all tests are for devnets, and the above // function is used for those tests. // pub fn mainnet_circuit_directory() -> &'static str { -// openmina_core::network::devnet::CIRCUITS_CONFIG.directory_name +// mina_core::network::devnet::CIRCUITS_CONFIG.directory_name // } // // pub fn circuit_directory() -> &'static str { -// openmina_core::NetworkConfig::global().circuits_config.directory_name +// mina_core::NetworkConfig::global().circuits_config.directory_name // } fn decode_gates_file( @@ -63,7 +63,7 @@ fn make_gates( Vec>>, Vec>, ) { - let circuits_config = openmina_core::NetworkConfig::global().circuits_config; + let circuits_config = mina_core::NetworkConfig::global().circuits_config; let base_dir = Path::new(&circuits_config.directory_name); let internal_vars_path = base_dir.join(format!("{}_internal_vars.bin", filename)); @@ -109,7 +109,7 @@ static ZKAPP_STEP_OPT_SIGNED_PROVER: OnceCell>> = OnceCell::new() static ZKAPP_STEP_PROOF_PROVER: OnceCell>> = OnceCell::new(); fn default_circuits_config() -> &'static CircuitsConfig { - openmina_core::NetworkConfig::global().circuits_config + mina_core::NetworkConfig::global().circuits_config } mod prover_makers { diff --git a/ledger/src/proofs/transaction.rs b/ledger/src/proofs/transaction.rs index a96f072708..a3bb3912fa 100644 --- a/ledger/src/proofs/transaction.rs +++ b/ledger/src/proofs/transaction.rs @@ -2264,8 +2264,8 @@ pub mod transaction_snark { transaction_logic::transaction_union_payload::{TransactionUnion, TransactionUnionPayload}, }; use ::poseidon::hash::legacy; + use mina_core::constants::constraint_constants; use mina_signer::Signature; - use openmina_core::constants::constraint_constants; use super::*; @@ -2570,7 +2570,7 @@ pub mod transaction_snark { inputs.append_field(*px); inputs.append_field(*py); inputs.append_field(*rx); - let signature_prefix = openmina_core::NetworkConfig::global().legacy_signature_prefix; + let signature_prefix = mina_core::NetworkConfig::global().legacy_signature_prefix; let hash = checked_legacy_hash(signature_prefix, inputs, w); w.exists(field_to_bits::<_, 255>(hash)) @@ -2632,7 +2632,7 @@ pub mod transaction_snark { inputs.append_field(*px); inputs.append_field(*py); inputs.append_field(*rx); - let signature_prefix = openmina_core::NetworkConfig::global().signature_prefix; + let signature_prefix = mina_core::NetworkConfig::global().signature_prefix; let hash = checked_hash(signature_prefix, &inputs.to_fields(), w); w.exists(field_to_bits::<_, 255>(hash)) diff --git a/ledger/src/proofs/verification.rs b/ledger/src/proofs/verification.rs index 8cdc05514a..07a2a8897c 100644 --- a/ledger/src/proofs/verification.rs +++ b/ledger/src/proofs/verification.rs @@ -737,9 +737,7 @@ pub fn verify_block( }; let Ok(protocol_state) = ProtocolState::try_from(protocol_state) else { - openmina_core::warn!( - message = format!("verify_block: Protocol state contains invalid field") - ); + mina_core::warn!(message = format!("verify_block: Protocol state contains invalid field")); return false; // invalid bigint }; let protocol_state_hash = MinaHash::hash(&protocol_state); @@ -749,7 +747,7 @@ pub fn verify_block( let verified = verify_impl(&protocol_state_hash, protocol_state_proof, &vk).unwrap_or(false); let ok = accum_check && verified; - openmina_core::info!(message = format!("verify_block OK={ok:?}")); + mina_core::info!(message = format!("verify_block OK={ok:?}")); if !ok { on_fail::dump_block_verification(header); @@ -790,7 +788,7 @@ pub fn verify_transaction<'a>( let verified = batch_verify_impl(inputs.as_slice()).unwrap_or(false); let ok = accum_check && verified; - openmina_core::info!(message = format!("verify_transactions OK={ok:?}")); + mina_core::info!(message = format!("verify_transactions OK={ok:?}")); if !ok { on_fail::dump_tx_verification(&inputs); @@ -820,7 +818,7 @@ pub fn verify_zkapp( let ok = accum_check && verified; - openmina_core::info!(message = format!("verify_zkapp OK={ok:?}")); + mina_core::info!(message = format!("verify_zkapp OK={ok:?}")); if !ok { on_fail::dump_zkapp_verification(verification_key, zkapp_statement, sideloaded_proof); @@ -981,7 +979,7 @@ mod on_fail { } if let Err(e) = dump_to_file_impl(data, filename) { - openmina_core::error!( + mina_core::error!( message = "Failed to dump proof verification data", error = format!("{e:?}") ); @@ -995,7 +993,7 @@ mod on_fail { vec }; - let debug_dir = openmina_core::get_debug_dir(); + let debug_dir = mina_core::get_debug_dir(); let filename = debug_dir .join(generate_new_filename(filename, "binprot", &bin)?) .to_string_lossy() @@ -1006,7 +1004,7 @@ mod on_fail { file.write_all(&bin)?; file.sync_all()?; - openmina_core::error!( + mina_core::error!( message = format!("proof verication failed, dumped data to {:?}", &filename) ); diff --git a/ledger/src/proofs/verifiers.rs b/ledger/src/proofs/verifiers.rs index 5adca43e3e..c14098e18f 100644 --- a/ledger/src/proofs/verifiers.rs +++ b/ledger/src/proofs/verifiers.rs @@ -5,8 +5,8 @@ use std::{ }; use anyhow::Context; +use mina_core::{info, log::system_time, warn}; use once_cell::sync::OnceCell; -use openmina_core::{info, log::system_time, warn}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -58,7 +58,7 @@ impl std::fmt::Display for Kind { } fn cache_filename(kind: Kind) -> PathBuf { - let circuits_config = openmina_core::NetworkConfig::global().circuits_config; + let circuits_config = mina_core::NetworkConfig::global().circuits_config; Path::new(circuits_config.directory_name).join(kind.filename()) } @@ -186,7 +186,7 @@ impl BlockVerifier { } fn src_json() -> &'static str { - let network_name = openmina_core::NetworkConfig::global().name; + let network_name = mina_core::NetworkConfig::global().name; match network_name { "mainnet" => include_str!("data/mainnet_blockchain_verifier_index.json"), "devnet" => include_str!("data/devnet_blockchain_verifier_index.json"), @@ -201,7 +201,7 @@ impl TransactionVerifier { } fn src_json() -> &'static str { - let network_name = openmina_core::NetworkConfig::global().name; + let network_name = mina_core::NetworkConfig::global().name; match network_name { "mainnet" => include_str!("data/mainnet_transaction_verifier_index.json"), "devnet" => include_str!("data/devnet_transaction_verifier_index.json"), diff --git a/ledger/src/scan_state/parallel_scan.rs b/ledger/src/scan_state/parallel_scan.rs index 42607aa13a..af5c317cf1 100644 --- a/ledger/src/scan_state/parallel_scan.rs +++ b/ledger/src/scan_state/parallel_scan.rs @@ -2601,7 +2601,7 @@ mod tests { }, }; - use openmina_core::thread; + use mina_core::thread; use rand::Rng; use super::*; diff --git a/ledger/src/scan_state/pending_coinbase.rs b/ledger/src/scan_state/pending_coinbase.rs index 83f2f9f7d8..1dd49d242c 100644 --- a/ledger/src/scan_state/pending_coinbase.rs +++ b/ledger/src/scan_state/pending_coinbase.rs @@ -21,9 +21,9 @@ use std::{collections::HashMap, fmt::Write, marker::PhantomData}; use ark_ff::{fields::arithmetic::InvalidBigInt, Zero}; +use mina_core::constants::constraint_constants; use mina_curves::pasta::Fp; use mina_signer::CompressedPubKey; -use openmina_core::constants::constraint_constants; use poseidon::hash::{ hash_noinputs, hash_with_kimchi, params::{ diff --git a/ledger/src/scan_state/scan_state.rs b/ledger/src/scan_state/scan_state.rs index 887d7e2915..8e275bf624 100644 --- a/ledger/src/scan_state/scan_state.rs +++ b/ledger/src/scan_state/scan_state.rs @@ -4,6 +4,7 @@ use blake2::{ digest::{generic_array::GenericArray, typenum::U32}, Digest, }; +use mina_core::{constants::ConstraintConstants, snark::SnarkJobId}; use mina_curves::pasta::Fp; use mina_p2p_messages::{ binprot, @@ -14,7 +15,6 @@ use mina_p2p_messages::{ }, }; use mina_signer::CompressedPubKey; -use openmina_core::{constants::ConstraintConstants, snark::SnarkJobId}; use sha2::Sha256; use crate::{ @@ -548,10 +548,10 @@ pub mod transaction_snark { pub type Checked = Work; - impl TryFrom<&openmina_core::snark::Snark> for Work { + impl TryFrom<&mina_core::snark::Snark> for Work { type Error = InvalidBigInt; - fn try_from(value: &openmina_core::snark::Snark) -> Result { + fn try_from(value: &mina_core::snark::Snark) -> Result { Ok(Self { prover: (&value.snarker).try_into()?, fee: (&value.fee).into(), diff --git a/ledger/src/scan_state/transaction_logic.rs b/ledger/src/scan_state/transaction_logic.rs index 3658a1a2c7..2a951a8d4d 100644 --- a/ledger/src/scan_state/transaction_logic.rs +++ b/ledger/src/scan_state/transaction_logic.rs @@ -5,14 +5,14 @@ use std::{ use ark_ff::{fields::arithmetic::InvalidBigInt, Zero}; use itertools::{FoldWhile, Itertools}; +use mina_core::constants::ConstraintConstants; use mina_hasher::{Fp, Hashable, ROInput}; +use mina_macros::SerdeYojsonEnum; use mina_p2p_messages::{ binprot, v2::{MinaBaseUserCommandStableV2, MinaTransactionTransactionStableV2}, }; use mina_signer::{CompressedPubKey, NetworkId}; -use openmina_core::constants::ConstraintConstants; -use openmina_macros::SerdeYojsonEnum; use poseidon::hash::{ hash_noinputs, hash_with_kimchi, params::{CODA_RECEIPT_UC, MINA_ZKAPP_MEMO}, @@ -2838,7 +2838,7 @@ pub mod zkapp_command { /// pub fn digest(&self) -> Fp { - self.hash_with_param(openmina_core::NetworkConfig::global().account_update_hash_param) + self.hash_with_param(mina_core::NetworkConfig::global().account_update_hash_param) } pub fn timing(&self) -> SetOrKeep { @@ -4238,8 +4238,8 @@ pub mod zkapp_statement { fn domain_string(network_id: NetworkId) -> Option { match network_id { - NetworkId::MAINNET => openmina_core::network::mainnet::SIGNATURE_PREFIX, - NetworkId::TESTNET => openmina_core::network::devnet::SIGNATURE_PREFIX, + NetworkId::MAINNET => mina_core::network::mainnet::SIGNATURE_PREFIX, + NetworkId::TESTNET => mina_core::network::devnet::SIGNATURE_PREFIX, } .to_string() .into() @@ -7314,8 +7314,8 @@ pub mod transaction_union_payload { fn domain_string(network_id: NetworkId) -> Option { // Domain strings must have length <= 20 match network_id { - NetworkId::MAINNET => openmina_core::network::mainnet::SIGNATURE_PREFIX, - NetworkId::TESTNET => openmina_core::network::devnet::SIGNATURE_PREFIX, + NetworkId::MAINNET => mina_core::network::mainnet::SIGNATURE_PREFIX, + NetworkId::TESTNET => mina_core::network::devnet::SIGNATURE_PREFIX, } .to_string() .into() diff --git a/ledger/src/sparse_ledger/sparse_ledger.rs b/ledger/src/sparse_ledger/sparse_ledger.rs index 82e56d8512..e4f49991f0 100644 --- a/ledger/src/sparse_ledger/sparse_ledger.rs +++ b/ledger/src/sparse_ledger/sparse_ledger.rs @@ -4,8 +4,8 @@ use std::{ }; use ark_ff::{fields::arithmetic::InvalidBigInt, Zero}; +use mina_core::constants::constraint_constants; use mina_curves::pasta::Fp; -use openmina_core::constants::constraint_constants; use crate::{ scan_state::{ diff --git a/ledger/src/staged_ledger/diff.rs b/ledger/src/staged_ledger/diff.rs index 2677759091..c73a426948 100644 --- a/ledger/src/staged_ledger/diff.rs +++ b/ledger/src/staged_ledger/diff.rs @@ -1,4 +1,4 @@ -use openmina_core::constants::ConstraintConstants; +use mina_core::constants::ConstraintConstants; use crate::{ scan_state::{ diff --git a/ledger/src/staged_ledger/pre_diff_info.rs b/ledger/src/staged_ledger/pre_diff_info.rs index 87cc98a37e..fd51d05056 100644 --- a/ledger/src/staged_ledger/pre_diff_info.rs +++ b/ledger/src/staged_ledger/pre_diff_info.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use itertools::{Either, Itertools}; +use mina_core::constants::ConstraintConstants; use mina_signer::CompressedPubKey; -use openmina_core::constants::ConstraintConstants; use crate::{ scan_state::{ diff --git a/ledger/src/staged_ledger/resources.rs b/ledger/src/staged_ledger/resources.rs index f6967c37d2..13ede9ca3f 100644 --- a/ledger/src/staged_ledger/resources.rs +++ b/ledger/src/staged_ledger/resources.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; +use mina_core::constants::ConstraintConstants; use mina_signer::CompressedPubKey; -use openmina_core::constants::ConstraintConstants; use crate::{ scan_state::{ diff --git a/ledger/src/staged_ledger/staged_ledger.rs b/ledger/src/staged_ledger/staged_ledger.rs index db76fa06d0..ad3c397e4e 100644 --- a/ledger/src/staged_ledger/staged_ledger.rs +++ b/ledger/src/staged_ledger/staged_ledger.rs @@ -1,9 +1,9 @@ use std::sync::Arc; +use mina_core::constants::ConstraintConstants; use mina_curves::pasta::Fp; use mina_p2p_messages::v2::MinaStateProtocolStateValueStableV2; use mina_signer::CompressedPubKey; -use openmina_core::constants::ConstraintConstants; use crate::{ decompress_pk, @@ -6259,7 +6259,7 @@ mod tests { let mut staged_ledger = StagedLedger::of_scan_state_pending_coinbases_and_snarked_ledger( (), - openmina_core::constants::constraint_constants(), + mina_core::constants::constraint_constants(), Verifier, scan_state, ledger, diff --git a/ledger/src/staged_ledger/transaction_validator.rs b/ledger/src/staged_ledger/transaction_validator.rs index d634401280..8f2f559777 100644 --- a/ledger/src/staged_ledger/transaction_validator.rs +++ b/ledger/src/staged_ledger/transaction_validator.rs @@ -1,4 +1,4 @@ -use openmina_core::constants::ConstraintConstants; +use mina_core::constants::ConstraintConstants; use crate::{ scan_state::{ diff --git a/ledger/src/transaction_pool.rs b/ledger/src/transaction_pool.rs index ff034264ba..57eb37bac0 100644 --- a/ledger/src/transaction_pool.rs +++ b/ledger/src/transaction_pool.rs @@ -6,9 +6,9 @@ use std::{ }; use itertools::Itertools; +use mina_core::{bug_condition, consensus::ConsensusConstants}; use mina_curves::pasta::Fp; use mina_p2p_messages::{bigint::BigInt, v2}; -use openmina_core::{bug_condition, consensus::ConsensusConstants}; use crate::{ scan_state::{ @@ -1440,8 +1440,8 @@ impl IndexedPool { } } } else { - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); kind = "transaction pool", message = "Sender queue is malformed"); all_by_sender.remove(&sender); } @@ -1504,8 +1504,8 @@ impl IndexedPool { } } } else { - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); kind = "transaction pool", message = "Sender queue is malformed"); self.all_by_sender.remove(&sender); } @@ -1667,8 +1667,8 @@ impl TransactionPool { .collect::>(); if !dropped_locally_generated.is_empty() { - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "transaction pool", message = "Dropped locally generated commands $cmds from pool when transition frontier was recreated.", dropped = format!("{dropped_locally_generated:?}") diff --git a/ledger/src/verifier/mod.rs b/ledger/src/verifier/mod.rs index b8cad2f9ed..3485bebebe 100644 --- a/ledger/src/verifier/mod.rs +++ b/ledger/src/verifier/mod.rs @@ -385,7 +385,7 @@ pub mod common { let Pallas { x, y, .. } = pubkey.point(); let Signature { rx, s } = signature; - let signature_prefix = openmina_core::NetworkConfig::global().signature_prefix; + let signature_prefix = mina_core::NetworkConfig::global().signature_prefix; let hash = hash_with_kimchi(signature_prefix, &[**msg, *x, *y, *rx]); let hash: Fq = Fq::try_from(hash.into_repr()).unwrap(); // Never fail, `Fq` is larger than `Fp` @@ -415,7 +415,7 @@ pub mod common { let Pallas { x, y, .. } = pubkey.point(); let Signature { rx, s } = signature; - let signature_prefix = openmina_core::NetworkConfig::global().legacy_signature_prefix; + let signature_prefix = mina_core::NetworkConfig::global().legacy_signature_prefix; let mut inputs = msg.to_input_legacy(); inputs.append_field(*x); diff --git a/ledger/src/zkapps/snark.rs b/ledger/src/zkapps/snark.rs index 01b6bd6dc2..a6e1c56d6b 100644 --- a/ledger/src/zkapps/snark.rs +++ b/ledger/src/zkapps/snark.rs @@ -286,7 +286,7 @@ impl CallForestInterface for SnarkCallForest { let account_update = w.exists(&account_update.body); let account_update = { let account_update_hash_param = - openmina_core::NetworkConfig::global().account_update_hash_param; + mina_core::NetworkConfig::global().account_update_hash_param; let hash = account_update.checked_hash_with_param(account_update_hash_param, w); WithHash { data: account_update.clone(), diff --git a/ledger/src/zkapps/zkapp_logic.rs b/ledger/src/zkapps/zkapp_logic.rs index dff4c575d7..bf14162a44 100644 --- a/ledger/src/zkapps/zkapp_logic.rs +++ b/ledger/src/zkapps/zkapp_logic.rs @@ -1,6 +1,6 @@ +use mina_core::constants::constraint_constants; use mina_curves::pasta::Fp; use mina_signer::CompressedPubKey; -use openmina_core::constants::constraint_constants; use crate::{ scan_state::{ diff --git a/macros/Cargo.toml b/macros/Cargo.toml index c94480878b..dacb765a32 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-macros" +name = "mina-macros" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -14,7 +14,7 @@ quote = "1.0.35" syn = "2.0.53" [dev-dependencies] -openmina-core = { path = "../core" } +mina-core = { path = "../core" } tracing = "0.1.40" rust-format = { version = "0.3", features = ["token_stream"] } anyhow = "1.0.81" diff --git a/macros/src/action_event.rs b/macros/src/action_event.rs index 22fca6e167..8d3b1424ce 100644 --- a/macros/src/action_event.rs +++ b/macros/src/action_event.rs @@ -64,7 +64,7 @@ pub fn expand(input: DeriveInput) -> Result { return Err(Error::new_spanned(input, "should be enum")); }; let type_name = &input.ident; - let trait_name = quote!(openmina_core::ActionEvent); // TODO + let trait_name = quote!(mina_core::ActionEvent); // TODO let input_attrs = action_event_attrs(&input.attrs)?; let variants = enum_data .variants @@ -103,7 +103,7 @@ pub fn expand(input: DeriveInput) -> Result { args.extend(fields(&variant_attrs.fields, &input_attrs.fields, fields_named)?); let level = level(&variant_attrs.level, &v.ident, &input_attrs.level); Ok(quote! { - #type_name :: #variant_name { #(#field_names),* } => openmina_core::#level!(#(#args),*), + #type_name :: #variant_name { #(#field_names),* } => mina_core::#level!(#(#args),*), }) } Fields::Unit => { @@ -116,7 +116,7 @@ pub fn expand(input: DeriveInput) -> Result { args.extend(summary_field(&v.attrs)?); let level = level(&variant_attrs.level, &v.ident, &input_attrs.level); Ok(quote! { - #type_name :: #variant_name => openmina_core::#level!(#(#args),*), + #type_name :: #variant_name => mina_core::#level!(#(#args),*), }) } } @@ -126,7 +126,7 @@ pub fn expand(input: DeriveInput) -> Result { Ok(quote! { impl #trait_name for #type_name { fn action_event(&self, context: &T) - where T: openmina_core::log::EventContext, + where T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { @@ -305,17 +305,17 @@ mod tests { #[test] fn test_delegate() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] pub enum SuperAction { Sub1(SubAction1), Sub2(SubAction2), } "#; let expected = r#" -impl openmina_core::ActionEvent for SuperAction { +impl mina_core::ActionEvent for SuperAction { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { @@ -331,7 +331,7 @@ impl openmina_core::ActionEvent for SuperAction { #[test] fn test_unit() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] pub enum Action { Unit, /// documentation @@ -344,16 +344,16 @@ pub enum Action { } "#; let expected = r#" -impl openmina_core::ActionEvent for Action { +impl mina_core::ActionEvent for Action { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { - Action::Unit => openmina_core::action_debug!(context), - Action::UnitWithDoc => openmina_core::action_debug!(context, summary = "documentation"), - Action::UnitWithMultilineDoc => openmina_core::action_debug!(context, summary = "Multiline documentation"), + Action::Unit => mina_core::action_debug!(context), + Action::UnitWithDoc => mina_core::action_debug!(context, summary = "documentation"), + Action::UnitWithMultilineDoc => mina_core::action_debug!(context, summary = "Multiline documentation"), } } } @@ -364,7 +364,7 @@ impl openmina_core::ActionEvent for Action { #[test] fn test_level() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] #[action_event(level = trace)] pub enum Action { ActionDefaultLevel, @@ -375,17 +375,17 @@ pub enum Action { } "#; let expected = r#" -impl openmina_core::ActionEvent for Action { +impl mina_core::ActionEvent for Action { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { - Action::ActionDefaultLevel => openmina_core::action_trace!(context), - Action::ActionOverrideLevel => openmina_core::action_warn!(context), - Action::ActionWithError => openmina_core::action_warn!(context), - Action::ActionWithWarn => openmina_core::action_warn!(context), + Action::ActionDefaultLevel => mina_core::action_trace!(context), + Action::ActionOverrideLevel => mina_core::action_warn!(context), + Action::ActionWithError => mina_core::action_warn!(context), + Action::ActionWithWarn => mina_core::action_warn!(context), } } } @@ -396,7 +396,7 @@ impl openmina_core::ActionEvent for Action { #[test] fn test_fields() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] pub enum Action { NoFields { f1: bool }, #[action_event(fields(f1))] @@ -414,20 +414,20 @@ pub enum Action { } "#; let expected = r#" -impl openmina_core::ActionEvent for Action { +impl mina_core::ActionEvent for Action { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { - Action::NoFields { f1 } => openmina_core::action_debug!(context), - Action::Field { f1 } => openmina_core::action_debug!(context, f1 = f1), - Action::FieldWithName { f1 } => openmina_core::action_debug!(context, f = f1), - Action::FieldExpr { f } => openmina_core::action_debug!(context, f = f.subfield), - Action::FieldDisplayExpr { f } => openmina_core::action_debug!(context, f = display(f.subfield)), - Action::DebugField { f1 } => openmina_core::action_debug!(context, f1 = debug(f1)), - Action::DisplayField { f1 } => openmina_core::action_debug!(context, f1 = display(f1)), + Action::NoFields { f1 } => mina_core::action_debug!(context), + Action::Field { f1 } => mina_core::action_debug!(context, f1 = f1), + Action::FieldWithName { f1 } => mina_core::action_debug!(context, f = f1), + Action::FieldExpr { f } => mina_core::action_debug!(context, f = f.subfield), + Action::FieldDisplayExpr { f } => mina_core::action_debug!(context, f = display(f.subfield)), + Action::DebugField { f1 } => mina_core::action_debug!(context, f1 = debug(f1)), + Action::DisplayField { f1 } => mina_core::action_debug!(context, f1 = display(f1)), } } } @@ -438,7 +438,7 @@ impl openmina_core::ActionEvent for Action { #[test] fn test_filtered_fields() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] #[action_event(fields(f1, f2 = f2.sub, f3 = display(f3.sub), f4 = foo()))] pub enum Action { Unit, @@ -448,17 +448,17 @@ pub enum Action { } "#; let expected = r#" -impl openmina_core::ActionEvent for Action { +impl mina_core::ActionEvent for Action { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { - Action::Unit => openmina_core::action_debug!(context), - Action::AllFields { f1, f2, f3 } => openmina_core::action_debug!(context, f1 = f1, f2 = f2.sub, f3 = display(f3.sub), f4 = foo()), - Action::OnlyF1 { f1 } => openmina_core::action_debug!(context, f1 = f1, f4 = foo()), - Action::WithF3 { f1, f3 } => openmina_core::action_debug!(context, f1 = f1, f3 = display(f3.sub), f4 = foo()), + Action::Unit => mina_core::action_debug!(context), + Action::AllFields { f1, f2, f3 } => mina_core::action_debug!(context, f1 = f1, f2 = f2.sub, f3 = display(f3.sub), f4 = foo()), + Action::OnlyF1 { f1 } => mina_core::action_debug!(context, f1 = f1, f4 = foo()), + Action::WithF3 { f1, f3 } => mina_core::action_debug!(context, f1 = f1, f3 = display(f3.sub), f4 = foo()), } } } @@ -469,7 +469,7 @@ impl openmina_core::ActionEvent for Action { #[test] fn test_call() -> anyhow::Result<()> { let input = r#" -#[derive(openmina_core::ActionEvent)] +#[derive(mina_core::ActionEvent)] pub enum Action { #[action_event(expr(foo(context)))] Unit, @@ -478,10 +478,10 @@ pub enum Action { } "#; let expected = r#" -impl openmina_core::ActionEvent for Action { +impl mina_core::ActionEvent for Action { fn action_event(&self, context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { #[allow(unused_variables)] match self { diff --git a/mina-p2p-messages/Cargo.toml b/mina-p2p-messages/Cargo.toml index 91c8ce2aa1..988b8c5fa7 100644 --- a/mina-p2p-messages/Cargo.toml +++ b/mina-p2p-messages/Cargo.toml @@ -25,7 +25,7 @@ strum_macros = "0.26.4" thiserror = "1.0.32" time = "0.3.36" -openmina-macros = { path = "../macros" } +mina-macros = { path = "../macros" } mina-curves = { workspace = true } mina-hasher = { workspace = true } diff --git a/mina-p2p-messages/src/v2/generated.rs b/mina-p2p-messages/src/v2/generated.rs index 43797615b5..8ce70d3443 100644 --- a/mina-p2p-messages/src/v2/generated.rs +++ b/mina-p2p-messages/src/v2/generated.rs @@ -2,7 +2,7 @@ use binprot_derive::{BinProtRead, BinProtWrite}; use derive_more::Deref; use malloc_size_of::MallocSizeOf; use malloc_size_of_derive::MallocSizeOf; -use openmina_macros::SerdeYojsonEnum; +use mina_macros::SerdeYojsonEnum; use rsexp_derive::{OfSexp, SexpOf}; use serde::{Deserialize, Serialize}; use std::sync::Arc; diff --git a/node/Cargo.toml b/node/Cargo.toml index 12bad11cbc..bbd14bcc70 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -40,8 +40,8 @@ vrf = { workspace = true } graphannis-malloc_size_of = { workspace = true } graphannis-malloc_size_of_derive = { workspace = true } -openmina-core = { path = "../core" } -openmina-node-account = { workspace = true } +mina-core = { path = "../core" } +mina-node-account = { workspace = true } p2p = { path = "../p2p" } postcard = { version = "1.0.9", features = ["use-std"] } snark = { path = "../snark" } diff --git a/node/account/Cargo.toml b/node/account/Cargo.toml index c6531df178..7a8b7c1ba4 100644 --- a/node/account/Cargo.toml +++ b/node/account/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-node-account" +name = "mina-node-account" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -9,10 +9,10 @@ anyhow = "1.0.70" bs58 = "0.4.0" hex = "0.4.3" lazy_static = "1.4.0" +mina-core = { path = "../../core" } mina-hasher = { workspace = true } mina-p2p-messages = { workspace = true } mina-signer = { workspace = true } -openmina-core = { path = "../../core" } rand = "0.8" serde = "1.0.147" serde_json = { version = "1.0.82", features = [ diff --git a/node/account/src/secret_key.rs b/node/account/src/secret_key.rs index 8fa2a25746..5be8c7b658 100644 --- a/node/account/src/secret_key.rs +++ b/node/account/src/secret_key.rs @@ -1,10 +1,10 @@ use std::{fmt, fs, io, path::Path, str::FromStr}; -use mina_p2p_messages::{bigint::BigInt, v2::SignatureLibPrivateKeyStableV1}; -use mina_signer::{keypair::KeypairError, seckey::SecKeyError, CompressedPubKey, Keypair}; -use openmina_core::{ +use mina_core::{ constants::GENESIS_PRODUCER_SK, EncryptedSecretKey, EncryptedSecretKeyFile, EncryptionError, }; +use mina_p2p_messages::{bigint::BigInt, v2::SignatureLibPrivateKeyStableV1}; +use mina_signer::{keypair::KeypairError, seckey::SecKeyError, CompressedPubKey, Keypair}; use rand::{rngs::StdRng, CryptoRng, Rng, SeedableRng}; use serde::{Deserialize, Serialize}; diff --git a/node/common/Cargo.toml b/node/common/Cargo.toml index ddcc072f41..e37e5343dd 100644 --- a/node/common/Cargo.toml +++ b/node/common/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-node-common" +name = "mina-node-common" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -24,8 +24,8 @@ tokio = { version = "1.26.0", features = ["time", "macros"] } tracing = "0.1.37" vrf = { workspace = true } +mina-core = { path = "../../core" } node = { path = "../../node", features = ["replay"] } -openmina-core = { path = "../../core" } rsa = "0.9" [target.'cfg(target_family = "wasm")'.dependencies] diff --git a/node/common/src/service/archive/aws.rs b/node/common/src/service/archive/aws.rs index 2a768de670..073dae1588 100644 --- a/node/common/src/service/archive/aws.rs +++ b/node/common/src/service/archive/aws.rs @@ -11,12 +11,10 @@ pub(crate) struct ArchiveAWSClient { impl ArchiveAWSClient { pub async fn new() -> Result { let config = aws_config::load_from_env().await; - let bucket_name = env::var("OPENMINA_AWS_BUCKET_NAME").map_err(|_| { - Error::EnvironmentVariableNotSet("OPENMINA_AWS_BUCKET_NAME".to_string()) - })?; - let bucket_path = env::var("OPENMINA_AWS_BUCKET_PATH").map_err(|_| { - Error::EnvironmentVariableNotSet("OPENMINA_AWS_BUCKET_PATH".to_string()) - })?; + let bucket_name = env::var("MINA_AWS_BUCKET_NAME") + .map_err(|_| Error::EnvironmentVariableNotSet("MINA_AWS_BUCKET_NAME".to_string()))?; + let bucket_path = env::var("MINA_AWS_BUCKET_PATH") + .map_err(|_| Error::EnvironmentVariableNotSet("MINA_AWS_BUCKET_PATH".to_string()))?; Ok(Self { client: aws_sdk_s3::Client::new(&config), bucket_name, diff --git a/node/common/src/service/archive/config.rs b/node/common/src/service/archive/config.rs index 490d55e249..6ce006bd63 100644 --- a/node/common/src/service/archive/config.rs +++ b/node/common/src/service/archive/config.rs @@ -24,10 +24,10 @@ impl ArchiveStorageOptions { pub fn validate_env_vars(&self) -> Result<(), String> { if self.contains(ArchiveStorageOptions::ARCHIVER_PROCESS) - && env::var("OPENMINA_ARCHIVE_ADDRESS").is_err() + && env::var("MINA_ARCHIVE_ADDRESS").is_err() { return Err( - "OPENMINA_ARCHIVE_ADDRESS is required when ARCHIVER_PROCESS is enabled".to_string(), + "MINA_ARCHIVE_ADDRESS is required when ARCHIVER_PROCESS is enabled".to_string(), ); } @@ -58,16 +58,16 @@ impl ArchiveStorageOptions { ); } - if env::var("OPENMINA_AWS_BUCKET_NAME").is_err() { + if env::var("MINA_AWS_BUCKET_NAME").is_err() { return Err( - "OPENMINA_AWS_BUCKET_NAME is required when AWS_PRECOMPUTED_STORAGE is enabled" + "MINA_AWS_BUCKET_NAME is required when AWS_PRECOMPUTED_STORAGE is enabled" .to_string(), ); } - // if env::var("OPENMINA_AWS_BUCKET_PATH").is_err() { + // if env::var("MINA_AWS_BUCKET_PATH").is_err() { // return Err( - // "OPENMINA_AWS_BUCKET_PATH is required when AWS_PRECOMPUTED_STORAGE is enabled" + // "MINA_AWS_BUCKET_PATH is required when AWS_PRECOMPUTED_STORAGE is enabled" // .to_string(), // ); // } diff --git a/node/common/src/service/archive/mod.rs b/node/common/src/service/archive/mod.rs index 04d5f2844c..645296e468 100644 --- a/node/common/src/service/archive/mod.rs +++ b/node/common/src/service/archive/mod.rs @@ -5,8 +5,8 @@ use node::{ }; use std::{env, io::Write}; +use mina_core::NetworkConfig; use mina_p2p_messages::v2::PrecomputedBlock; -use openmina_core::NetworkConfig; use std::net::SocketAddr; use super::NodeService; @@ -64,7 +64,7 @@ impl ArchiveServiceClients { }; let local_path = if options.uses_local_precomputed_storage() { - let env_path = env::var("OPENMINA_LOCAL_PRECOMPUTED_STORAGE_PATH"); + let env_path = env::var("MINA_LOCAL_PRECOMPUTED_STORAGE_PATH"); let default = format!("{}/archive-precomputed", work_dir); Some(env_path.unwrap_or(default)) } else { @@ -72,8 +72,8 @@ impl ArchiveServiceClients { }; let archiver_address = if options.uses_archiver_process() { - let address = std::env::var("OPENMINA_ARCHIVE_ADDRESS") - .expect("OPENMINA_ARCHIVE_ADDRESS is not set"); + let address = + std::env::var("MINA_ARCHIVE_ADDRESS").expect("MINA_ARCHIVE_ADDRESS is not set"); let address = reqwest::Url::parse(&address).expect("Invalid URL"); // Convert URL to SocketAddr @@ -276,7 +276,7 @@ impl ArchiveService { .unwrap(); thread::Builder::new() - .name("openmina_archive".to_owned()) + .name("mina_archive".to_owned()) .spawn(move || { runtime.block_on(Self::run(archive_receiver, options, work_dir)); }) @@ -290,7 +290,7 @@ impl ArchiveService { work_dir: String, ) { thread::Builder::new() - .name("openmina_archive".to_owned()) + .name("mina_archive".to_owned()) .spawn(move || { Self::run(archive_receiver, options, work_dir); }) diff --git a/node/common/src/service/block_producer/mod.rs b/node/common/src/service/block_producer/mod.rs index da23afdb26..b182bb3778 100644 --- a/node/common/src/service/block_producer/mod.rs +++ b/node/common/src/service/block_producer/mod.rs @@ -61,7 +61,7 @@ impl BlockProducerService { let event_sender_clone = event_sender.clone(); let producer_keypair = keypair.clone(); thread::Builder::new() - .name("openmina_vrf_evaluator".to_owned()) + .name("mina_vrf_evaluator".to_owned()) .spawn(move || { vrf_evaluator::vrf_evaluator( event_sender_clone, @@ -73,7 +73,7 @@ impl BlockProducerService { let producer_keypair = keypair.clone(); thread::Builder::new() - .name("openmina_block_prover".to_owned()) + .name("mina_block_prover".to_owned()) .spawn(move || prover_loop(producer_keypair, event_sender, prove_receiver)) .unwrap(); @@ -106,9 +106,9 @@ fn prover_loop( let (provers, block_hash, mut input) = msg.0; let res = prove(provers, &mut input, &keypair, false); if let Err(error) = &res { - openmina_core::error!(message = "Block proof failed", error = format!("{error:?}")); + mina_core::error!(message = "Block proof failed", error = format!("{error:?}")); if let Err(error) = dump_failed_block_proof_input(block_hash.clone(), input, error) { - openmina_core::error!( + mina_core::error!( message = "Failure when dumping failed block proof inputs", error = format!("{error}") ); @@ -239,12 +239,12 @@ kGqG7QLzSPjAtP/YbUponwaD+t+A0kBg0hV4hhcJOkPeA2NOi04K93bz3HuYCVRe }, }; - let debug_dir = openmina_core::get_debug_dir(); + let debug_dir = mina_core::get_debug_dir(); let filename = debug_dir .join(format!("failed_block_proof_input_{block_hash}.binprot")) .to_string_lossy() .to_string(); - openmina_core::warn!(message = "Dumping failed block proof.", filename = filename); + mina_core::warn!(message = "Dumping failed block proof.", filename = filename); std::fs::create_dir_all(&debug_dir)?; let mut file = std::fs::File::create(&filename)?; input.binprot_write(&mut file)?; diff --git a/node/common/src/service/block_producer/vrf_evaluator.rs b/node/common/src/service/block_producer/vrf_evaluator.rs index e31a521032..299c0b620c 100644 --- a/node/common/src/service/block_producer/vrf_evaluator.rs +++ b/node/common/src/service/block_producer/vrf_evaluator.rs @@ -18,7 +18,7 @@ pub fn vrf_evaluator( ) { while let Some(vrf_evaluator_input) = vrf_evaluation_receiver.blocking_recv() { // let bytes = serde_json::to_string(&vrf_evaluator_input).unwrap(); - // openmina_core::http::download("vrf.json".to_string(), bytes.as_bytes().to_vec()).unwrap(); + // mina_core::http::download("vrf.json".to_string(), bytes.as_bytes().to_vec()).unwrap(); let keypair = &keypair; let VrfEvaluatorInput { @@ -123,7 +123,7 @@ mod tests { // let elapsed = now.elapsed(); // let slot = global_slot; // eprintln!("vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}"); - // openmina_core::info!(openmina_core::log::system_time(); "vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}"); + // mina_core::info!(mina_core::log::system_time(); "vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}"); // nevaluated.fetch_add(1, std::sync::atomic::Ordering::AcqRel); diff --git a/node/common/src/service/rpc/mod.rs b/node/common/src/service/rpc/mod.rs index ec43ef6122..6fd5a7f967 100644 --- a/node/common/src/service/rpc/mod.rs +++ b/node/common/src/service/rpc/mod.rs @@ -139,7 +139,7 @@ macro_rules! state_field_filter { /// field, returns [None]. /// /// ```ignore -/// use openmina_node_native::rpc::strip_root_field; +/// use mina_node_native::rpc::strip_root_field; /// /// let filter = strip_root_field("$.field", "field"); /// assert_eq!(filter, Some("")); diff --git a/node/invariants/Cargo.toml b/node/invariants/Cargo.toml index 71afd1a040..b179de26a6 100644 --- a/node/invariants/Cargo.toml +++ b/node/invariants/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "openmina-node-invariants" +name = "mina-node-invariants" version = "0.16.0" edition = "2021" license = "Apache-2.0" [lib] -name = "openmina_node_invariants" +name = "mina_node_invariants" path = "src/lib.rs" [dependencies] diff --git a/node/native/Cargo.toml b/node/native/Cargo.toml index 7db7e2f635..b8b02e9af8 100644 --- a/node/native/Cargo.toml +++ b/node/native/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-node-native" +name = "mina-node-native" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -37,14 +37,14 @@ tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] } vrf = { workspace = true } warp = "0.3" +mina-core = { path = "../../core" } +mina-node-common = { path = "../common" } node = { path = "../../node", features = ["replay"] } -openmina-core = { path = "../../core" } -openmina-node-common = { path = "../common" } [dev-dependencies] -openmina-producer-dashboard = { workspace = true } +mina-producer-dashboard = { workspace = true } [features] default = ["p2p-libp2p"] -p2p-webrtc = ["openmina-node-common/p2p-webrtc"] -p2p-libp2p = ["openmina-node-common/p2p-libp2p"] +p2p-webrtc = ["mina-node-common/p2p-webrtc"] +p2p-libp2p = ["mina-node-common/p2p-libp2p"] diff --git a/node/native/src/graphql/account.rs b/node/native/src/graphql/account.rs index f2d8db6b14..4e5b4feb5a 100644 --- a/node/native/src/graphql/account.rs +++ b/node/native/src/graphql/account.rs @@ -6,6 +6,7 @@ use ledger::{ scan_state::currency::{Balance, Magnitude, Slot}, Account, AccountId, FpExt, Timing, }; +use mina_node_common::rpc::RpcSender; use mina_p2p_messages::{ string::{TokenSymbol, ZkAppUri}, v2::{ @@ -15,7 +16,6 @@ use mina_p2p_messages::{ }; use mina_signer::CompressedPubKey; use node::rpc::{AccountQuery, RpcRequest}; -use openmina_node_common::rpc::RpcSender; use super::{Context, ConversionError}; diff --git a/node/native/src/graphql/block.rs b/node/native/src/graphql/block.rs index e253023a0f..e58440b716 100644 --- a/node/native/src/graphql/block.rs +++ b/node/native/src/graphql/block.rs @@ -4,13 +4,13 @@ use crate::graphql::{ }; use juniper::{graphql_object, FieldResult, GraphQLEnum, GraphQLObject}; use ledger::AccountId; +use mina_core::block::AppliedBlock; use mina_p2p_messages::v2::{ MinaBaseSignedCommandPayloadBodyStableV2, MinaBaseSignedCommandStableV2, MinaBaseStakeDelegationStableV2, TransactionSnarkWorkTStableV2, }; use mina_signer::CompressedPubKey; use node::account::AccountPublicKey; -use openmina_core::block::AppliedBlock; use super::{zkapp::GraphQLZkapp, Context, ConversionError}; diff --git a/node/native/src/graphql/constants.rs b/node/native/src/graphql/constants.rs index 2067b00356..388e93d2ed 100644 --- a/node/native/src/graphql/constants.rs +++ b/node/native/src/graphql/constants.rs @@ -1,4 +1,8 @@ use juniper::GraphQLObject; +use mina_core::{ + consensus::{ConsensusConstants, ConsensusTime}, + constants::ConstraintConstants, +}; use node::{ rpc::{ ConsensusTimeQuery, PeerConnectionStatus, RpcConsensusTimeGetResponse, @@ -6,10 +10,6 @@ use node::{ }, BuildEnv, }; -use openmina_core::{ - consensus::{ConsensusConstants, ConsensusTime}, - constants::ConstraintConstants, -}; use super::{Context, ConversionError, Error}; diff --git a/node/native/src/graphql/mod.rs b/node/native/src/graphql/mod.rs index 802436b03a..4b06ebf627 100644 --- a/node/native/src/graphql/mod.rs +++ b/node/native/src/graphql/mod.rs @@ -2,6 +2,11 @@ use account::{create_account_loader, AccountLoader, GraphQLAccount}; use block::{GraphQLBlock, GraphQLSnarkJob, GraphQLUserCommands}; use juniper::{graphql_value, EmptySubscription, FieldError, GraphQLEnum, RootNode}; use ledger::{Account, AccountId}; +use mina_core::{ + block::AppliedBlock, consensus::ConsensusConstants, constants::constraint_constants, + NetworkConfig, +}; +use mina_node_common::rpc::RpcSender; use mina_p2p_messages::v2::{ conv, LedgerHash, MinaBaseSignedCommandStableV2, MinaBaseUserCommandStableV2, MinaBaseZkappCommandTStableV1WireStableV1, TokenIdKeyHash, TransactionHash, @@ -23,11 +28,6 @@ use node::{ BuildEnv, }; use o1_utils::field_helpers::FieldHelpersError; -use openmina_core::{ - block::AppliedBlock, consensus::ConsensusConstants, constants::constraint_constants, - NetworkConfig, -}; -use openmina_node_common::rpc::RpcSender; use snark::{GraphQLPendingSnarkWork, GraphQLSnarkWorker}; use std::str::FromStr; use tokio::sync::OnceCell; diff --git a/node/native/src/http_server.rs b/node/native/src/http_server.rs index 2473e8a5dc..5032f6294f 100644 --- a/node/native/src/http_server.rs +++ b/node/native/src/http_server.rs @@ -11,7 +11,7 @@ use warp::{ use node::{core::snark::SnarkJobId, rpc::*}; -use openmina_node_common::rpc::{ +use mina_node_common::rpc::{ RpcActionStatsGetResponse, RpcSender, RpcSnarkPoolGetResponse, RpcSnarkerJobCommitResponse, RpcSnarkerJobSpecResponse, RpcStateGetResponse, RpcSyncStatsGetResponse, }; @@ -663,10 +663,10 @@ fn readiness( } mod discovery { + use mina_node_common::rpc::RpcSender; use node::rpc::{ RpcDiscoveryBoostrapStatsResponse, RpcDiscoveryRoutingTableResponse, RpcRequest, }; - use openmina_node_common::rpc::RpcSender; use warp::Filter; use super::{with_rpc_sender, DroppedChannel}; diff --git a/node/native/src/lib.rs b/node/native/src/lib.rs index b1a23b53da..e6eb20834a 100644 --- a/node/native/src/lib.rs +++ b/node/native/src/lib.rs @@ -1,4 +1,4 @@ -pub use openmina_node_common::*; +pub use mina_node_common::*; pub mod graphql; pub mod http_server; diff --git a/node/native/src/node/builder.rs b/node/native/src/node/builder.rs index eec812882f..32bc7ad362 100644 --- a/node/native/src/node/builder.rs +++ b/node/native/src/node/builder.rs @@ -9,6 +9,8 @@ use std::{ use anyhow::Context; use ledger::proofs::provers::BlockProver; +use mina_core::{consensus::ConsensusConstants, constants::constraint_constants}; +use mina_node_common::{archive::config::ArchiveStorageOptions, p2p::TaskSpawner}; use mina_p2p_messages::v2::{self, NonZeroCurvePoint}; use node::{ account::AccountSecretKey, @@ -23,8 +25,6 @@ use node::{ BlockProducerConfig, GlobalConfig, LedgerConfig, P2pConfig, SnarkConfig, SnarkerConfig, SnarkerStrategy, TransitionFrontierConfig, }; -use openmina_core::{consensus::ConsensusConstants, constants::constraint_constants}; -use openmina_node_common::{archive::config::ArchiveStorageOptions, p2p::TaskSpawner}; use rand::Rng; use crate::NodeServiceBuilder; @@ -385,7 +385,7 @@ impl NodeBuilder { } fn default_peers() -> Vec { - openmina_core::NetworkConfig::global() + mina_core::NetworkConfig::global() .default_peers .iter() .map(|s| s.parse().unwrap()) @@ -408,13 +408,13 @@ fn peers_from_reader( if let Some(opts) = opts.with_host_resolved() { peers.push(opts); } else { - openmina_core::warn!( + mina_core::warn!( "Peer address name resolution failed, skipping: {:?}", trimmed ); } } - Err(e) => openmina_core::warn!("Peer address parse error: {:?}", e), + Err(e) => mina_core::warn!("Peer address parse error: {:?}", e), } } Ok(()) diff --git a/node/native/src/node/mod.rs b/node/native/src/node/mod.rs index 2d84086e9b..cc75eb7f93 100644 --- a/node/native/src/node/mod.rs +++ b/node/native/src/node/mod.rs @@ -1,4 +1,4 @@ mod builder; pub use builder::*; -pub type Node = openmina_node_common::Node; +pub type Node = mina_node_common::Node; diff --git a/node/native/src/service/builder.rs b/node/native/src/service/builder.rs index f3c1b271b8..880cd31f9a 100644 --- a/node/native/src/service/builder.rs +++ b/node/native/src/service/builder.rs @@ -1,13 +1,13 @@ use ledger::proofs::provers::BlockProver; +pub use mina_node_common::NodeServiceCommonBuildError; +use mina_node_common::{ + archive::config::ArchiveStorageOptions, p2p::TaskSpawner, rpc::RpcSender, EventSender, + NodeServiceCommonBuilder, +}; use node::{ account::AccountSecretKey, core::thread, p2p::identity::SecretKey as P2pSecretKey, service::Recorder, }; -pub use openmina_node_common::NodeServiceCommonBuildError; -use openmina_node_common::{ - archive::config::ArchiveStorageOptions, p2p::TaskSpawner, rpc::RpcSender, EventSender, - NodeServiceCommonBuilder, -}; use crate::{http_server, NodeService, P2pTaskSpawner}; @@ -94,7 +94,7 @@ impl NodeServiceBuilder { .build() .unwrap(); thread::Builder::new() - .name("openmina_http_server".to_owned()) + .name("mina_http_server".to_owned()) .spawn(move || runtime.block_on(http_server::run(port, rpc_sender))) .unwrap(); self diff --git a/node/native/src/service/ext_snark_worker.rs b/node/native/src/service/ext_snark_worker.rs index 543c8ee250..9083894706 100644 --- a/node/native/src/service/ext_snark_worker.rs +++ b/node/native/src/service/ext_snark_worker.rs @@ -455,7 +455,7 @@ mod tests { event_source::Event, external_snark_worker::{ExternalSnarkWorkerEvent, SnarkWorkSpec}, }; - use openmina_node_common::tracing; + use mina_node_common::tracing; use super::ExternalSnarkWorkerFacade; diff --git a/node/native/src/service/mod.rs b/node/native/src/service/mod.rs index ef11b4c385..79ea3e026a 100644 --- a/node/native/src/service/mod.rs +++ b/node/native/src/service/mod.rs @@ -1,8 +1,8 @@ mod builder; pub use builder::*; -use openmina_node_common::p2p::TaskSpawner; -pub use openmina_node_common::NodeService; +use mina_node_common::p2p::TaskSpawner; +pub use mina_node_common::NodeService; use node::core::thread; @@ -19,7 +19,7 @@ impl TaskSpawner for P2pTaskSpawner { .build() .unwrap(); thread::Builder::new() - .name(format!("openmina_p2p_{name}")) + .name(format!("mina_p2p_{name}")) .spawn(move || { let local_set = tokio::task::LocalSet::new(); local_set.block_on(&runtime, fut); diff --git a/node/src/account.rs b/node/src/account.rs index 5cbc119ef1..304cc7fbf3 100644 --- a/node/src/account.rs +++ b/node/src/account.rs @@ -1 +1 @@ -pub use openmina_node_account::*; +pub use mina_node_account::*; diff --git a/node/src/block_producer/block_producer_actions.rs b/node/src/block_producer/block_producer_actions.rs index cca3491bdc..4142eba4a3 100644 --- a/node/src/block_producer/block_producer_actions.rs +++ b/node/src/block_producer/block_producer_actions.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use ledger::scan_state::transaction_logic::valid; +use mina_core::{block::ArcBlockWithHash, ActionEvent}; use mina_p2p_messages::v2::MinaBaseProofStableV2; -use openmina_core::{block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; use crate::block_producer_effectful::StagedLedgerDiffCreateOutput; @@ -27,9 +27,9 @@ pub enum BlockProducerAction { level = info, fields( slot = won_slot.global_slot.slot_number.as_u32(), - slot_time = openmina_core::log::to_rfc_3339(won_slot.slot_time) + slot_time = mina_core::log::to_rfc_3339(won_slot.slot_time) .unwrap_or_else(|_| "".to_owned()), - current_time = openmina_core::log::to_rfc_3339(context.timestamp()) + current_time = mina_core::log::to_rfc_3339(context.timestamp()) .unwrap_or_else(|_| "".to_owned()), ) )] diff --git a/node/src/block_producer/block_producer_reducer.rs b/node/src/block_producer/block_producer_reducer.rs index e339ca89df..42096160a0 100644 --- a/node/src/block_producer/block_producer_reducer.rs +++ b/node/src/block_producer/block_producer_reducer.rs @@ -1,6 +1,5 @@ use ledger::scan_state::currency::{Amount, Signed}; -use mina_p2p_messages::{list::List, v2}; -use openmina_core::{ +use mina_core::{ block::ArcBlockWithHash, bug_condition, consensus::{ @@ -9,6 +8,7 @@ use openmina_core::{ }, constants::constraint_constants, }; +use mina_p2p_messages::{list::List, v2}; use p2p::P2pNetworkPubsubAction; use redux::{callback, Dispatcher, Timestamp}; @@ -677,7 +677,7 @@ impl BlockProducerEnabled { }, }; let Ok(block_hash) = block.protocol_state.try_hash() else { - openmina_core::log::inner::error!("Invalid protocol state"); + mina_core::log::inner::error!("Invalid protocol state"); return; }; diff --git a/node/src/block_producer/block_producer_state.rs b/node/src/block_producer/block_producer_state.rs index 9463a50b8b..566c069a27 100644 --- a/node/src/block_producer/block_producer_state.rs +++ b/node/src/block_producer/block_producer_state.rs @@ -1,11 +1,11 @@ use std::{collections::BTreeSet, sync::Arc, time::Duration}; use ledger::scan_state::transaction_logic::valid; -use mina_p2p_messages::v2; -use openmina_core::{ +use mina_core::{ block::{AppliedBlock, ArcBlockWithHash}, consensus::consensus_take, }; +use mina_p2p_messages::v2; use serde::{Deserialize, Serialize}; use crate::account::AccountPublicKey; diff --git a/node/src/block_producer/mod.rs b/node/src/block_producer/mod.rs index 5f45fbfa74..9960461be0 100644 --- a/node/src/block_producer/mod.rs +++ b/node/src/block_producer/mod.rs @@ -17,8 +17,8 @@ pub use block_producer_actions::*; mod block_producer_reducer; use ledger::AccountIndex; +use mina_core::{block::ArcBlockWithHash, constants::constraint_constants}; use mina_p2p_messages::{list::List, v2}; -use openmina_core::{block::ArcBlockWithHash, constants::constraint_constants}; use poseidon::hash::params::MINA_EPOCH_SEED; use serde::{Deserialize, Serialize}; use vrf::output::VrfOutput; diff --git a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs index 52116aa15a..83b1649270 100644 --- a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs +++ b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs @@ -4,11 +4,11 @@ use crate::{ account::AccountPublicKey, block_producer::vrf_evaluator::{BlockProducerVrfEvaluatorStatus, EpochContext}, }; +use mina_core::{action_info, action_trace, block::ArcBlockWithHash, ActionEvent}; use mina_p2p_messages::v2::{ ConsensusProofOfStakeDataEpochDataNextValueVersionedValueStableV1, ConsensusProofOfStakeDataEpochDataStakingValueVersionedValueStableV1, LedgerHash, }; -use openmina_core::{action_info, action_trace, block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; use vrf::{VrfEvaluationOutput, VrfWonSlot}; @@ -226,7 +226,7 @@ impl From for crate::Action { fn log_vrf_output(context: &T, vrf_output: &VrfEvaluationOutput) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { match vrf_output { VrfEvaluationOutput::SlotWon(VrfWonSlot { diff --git a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs index 9136b8c45c..722ab972a9 100644 --- a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs +++ b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::bug_condition; +use mina_core::bug_condition; use vrf::VrfEvaluationOutput; use crate::{ @@ -307,7 +307,7 @@ impl BlockProducerVrfEvaluatorState { return; }; - openmina_core::log::warn!( + mina_core::log::warn!( meta.time(); kind = "BlockProducerVrfEvaluatorAction::FinalizeDelegatorTableConstruction", message = "Empty delegator table, account may not exist yet in the staking ledger" diff --git a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_state.rs b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_state.rs index 604a522fdd..5f7ab91ede 100644 --- a/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_state.rs +++ b/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_state.rs @@ -1,7 +1,7 @@ use std::{collections::BTreeMap, sync::Arc}; +use mina_core::block::ArcBlockWithHash; use mina_p2p_messages::v2; -use openmina_core::block::ArcBlockWithHash; use serde::{Deserialize, Serialize}; use crate::{account::AccountPublicKey, block_producer::BlockProducerWonSlot}; @@ -598,6 +598,7 @@ mod test { use lazy_static::lazy_static; use ledger::AccountIndex; + use mina_node_account::AccountSecretKey; use mina_p2p_messages::{ bigint::BigInt, number::Number, @@ -609,7 +610,6 @@ mod test { UnsignedExtendedUInt64Int64ForVersionTagsStableV1, }, }; - use openmina_node_account::AccountSecretKey; use vrf::VrfWonSlot; use crate::block_producer::vrf_evaluator::{ diff --git a/node/src/block_producer_effectful/block_producer_effectful_actions.rs b/node/src/block_producer_effectful/block_producer_effectful_actions.rs index 0089e0e6cd..63cfcd6847 100644 --- a/node/src/block_producer_effectful/block_producer_effectful_actions.rs +++ b/node/src/block_producer_effectful/block_producer_effectful_actions.rs @@ -1,6 +1,6 @@ use super::vrf_evaluator_effectful::BlockProducerVrfEvaluatorEffectfulAction; use crate::block_producer::{BlockProducerWonSlot, BlockProducerWonSlotDiscardReason}; -use openmina_core::{block::ArcBlockWithHash, ActionEvent}; +use mina_core::{block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/node/src/block_producer_effectful/block_producer_effectful_effects.rs b/node/src/block_producer_effectful/block_producer_effectful_effects.rs index fa36cb02c3..bfe8d61ebd 100644 --- a/node/src/block_producer_effectful/block_producer_effectful_effects.rs +++ b/node/src/block_producer_effectful/block_producer_effectful_effects.rs @@ -3,11 +3,11 @@ use crate::{ ledger::write::{LedgerWriteAction, LedgerWriteRequest}, BlockProducerAction, Store, }; +use mina_node_account::AccountSecretKey; use mina_p2p_messages::v2::{ BlockchainSnarkBlockchainStableV2, ConsensusStakeProofStableV2, MinaStateSnarkTransitionValueStableV2, ProverExtendBlockchainInputStableV2, }; -use openmina_node_account::AccountSecretKey; use redux::ActionWithMeta; use super::BlockProducerEffectfulAction; @@ -119,7 +119,7 @@ pub fn block_producer_effects( let state_hash = block_hash.to_string(); let global_slot_since_genesis = cs.global_slot_since_genesis.as_u32(); let height = cs.blockchain_length.as_u32(); - openmina_core::info!( + mina_core::info!( meta.time(); message = "Unproven block built", state_hash = state_hash, diff --git a/node/src/block_producer_effectful/block_producer_effectful_service.rs b/node/src/block_producer_effectful/block_producer_effectful_service.rs index 41ea20b4fe..e589194861 100644 --- a/node/src/block_producer_effectful/block_producer_effectful_service.rs +++ b/node/src/block_producer_effectful/block_producer_effectful_service.rs @@ -1,13 +1,13 @@ use std::sync::Arc; use ledger::proofs::provers::BlockProver; +use mina_node_account::AccountSecretKey; use mina_p2p_messages::v2::{ ConsensusBodyReferenceStableV1, LedgerProofProdStableV2, MinaBasePendingCoinbaseUpdateStableV1, MinaBasePendingCoinbaseWitnessStableV2, MinaBaseSparseLedgerBaseStableV2, MinaBaseStagedLedgerHashStableV1, ProverExtendBlockchainInputStableV2, StagedLedgerDiffDiffStableV2, StateHash, }; -use openmina_node_account::AccountSecretKey; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/node/src/block_producer_effectful/vrf_evaluator_effectful/block_producer_vrf_evaluator_effectful_actions.rs b/node/src/block_producer_effectful/vrf_evaluator_effectful/block_producer_vrf_evaluator_effectful_actions.rs index 199bc34f18..f6bcb0cb94 100644 --- a/node/src/block_producer_effectful/vrf_evaluator_effectful/block_producer_vrf_evaluator_effectful_actions.rs +++ b/node/src/block_producer_effectful/vrf_evaluator_effectful/block_producer_vrf_evaluator_effectful_actions.rs @@ -1,5 +1,5 @@ use crate::block_producer::vrf_evaluator::VrfEvaluatorInput; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/node/src/config.rs b/node/src/config.rs index f96ed12281..8e1b359039 100644 --- a/node/src/config.rs +++ b/node/src/config.rs @@ -1,7 +1,7 @@ use std::{str::FromStr, sync::Arc}; +use mina_core::consensus::ConsensusConstants; use mina_p2p_messages::v2::CurrencyFeeStableV1; -use openmina_core::consensus::ConsensusConstants; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/node/src/daemon_json/json_genesis.rs b/node/src/daemon_json/json_genesis.rs index 64975169da..7004c7b0a8 100644 --- a/node/src/daemon_json/json_genesis.rs +++ b/node/src/daemon_json/json_genesis.rs @@ -1,11 +1,11 @@ use serde::{Deserialize, Serialize}; use time::{format_description::well_known::Rfc3339, OffsetDateTime}; +use mina_core::constants::PROTOCOL_CONSTANTS; use mina_p2p_messages::v2::{ BlockTimeTimeStableV1, MinaBaseProtocolConstantsCheckedValueStableV1, UnsignedExtendedUInt32StableV1, }; -use openmina_core::constants::PROTOCOL_CONSTANTS; #[serde_with::serde_as] #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/node/src/daemon_json/json_ledger.rs b/node/src/daemon_json/json_ledger.rs index 30e217b9b9..1f46ada290 100644 --- a/node/src/daemon_json/json_ledger.rs +++ b/node/src/daemon_json/json_ledger.rs @@ -11,7 +11,7 @@ use ledger::{ AuthRequired, Permissions, ReceiptChainHash, SetVerificationKey, Timing, TokenId, TokenSymbol, VotingFor, ZkAppAccount, ZkAppUri, }; -use openmina_node_account::{AccountPublicKey, AccountSecretKey}; +use mina_node_account::{AccountPublicKey, AccountSecretKey}; use crate::ledger::LEDGER_DEPTH; diff --git a/node/src/daemon_json/mod.rs b/node/src/daemon_json/mod.rs index f863cd0ef6..c6eeddf36c 100644 --- a/node/src/daemon_json/mod.rs +++ b/node/src/daemon_json/mod.rs @@ -62,7 +62,7 @@ impl EpochData { mod test { use ledger::{scan_state::currency::Balance, Timing}; - use openmina_node_account::AccountPublicKey; + use mina_node_account::AccountPublicKey; use std::str::FromStr; use crate::daemon_json::DaemonJson; diff --git a/node/src/effects.rs b/node/src/effects.rs index 69eec2e4aa..41a8310e2d 100644 --- a/node/src/effects.rs +++ b/node/src/effects.rs @@ -1,4 +1,4 @@ -use openmina_core::log::system_time; +use mina_core::log::system_time; use rand::prelude::*; use crate::{ diff --git a/node/src/event_source/event_source_effects.rs b/node/src/event_source/event_source_effects.rs index b99d31343d..51ecf12a85 100644 --- a/node/src/event_source/event_source_effects.rs +++ b/node/src/event_source/event_source_effects.rs @@ -213,7 +213,7 @@ pub fn event_source_effects(store: &mut Store, action: EventSourc P2pEvent::Channel(e) => match e { P2pChannelEvent::Opened(peer_id, chan_id, res) => match res { Err(err) => { - openmina_core::log::warn!(meta.time(); kind = "P2pChannelEvent::Opened", peer_id = peer_id.to_string(), error = err); + mina_core::log::warn!(meta.time(); kind = "P2pChannelEvent::Opened", peer_id = peer_id.to_string(), error = err); // TODO(binier): dispatch error action. } Ok(_) => match chan_id { diff --git a/node/src/external_snark_worker/external_snark_worker_actions.rs b/node/src/external_snark_worker/external_snark_worker_actions.rs index 43f2183ae5..3cd54519a1 100644 --- a/node/src/external_snark_worker/external_snark_worker_actions.rs +++ b/node/src/external_snark_worker/external_snark_worker_actions.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use openmina_core::{snark::SnarkJobId, ActionEvent}; +use mina_core::{snark::SnarkJobId, ActionEvent}; use redux::{EnablingCondition, Timestamp}; use serde::{Deserialize, Serialize}; diff --git a/node/src/external_snark_worker/external_snark_worker_reducer.rs b/node/src/external_snark_worker/external_snark_worker_reducer.rs index 3d93afc3c8..0c70646b02 100644 --- a/node/src/external_snark_worker/external_snark_worker_reducer.rs +++ b/node/src/external_snark_worker/external_snark_worker_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::snark::Snark; +use mina_core::snark::Snark; use redux::Timestamp; use super::{ diff --git a/node/src/external_snark_worker/external_snark_worker_types.rs b/node/src/external_snark_worker/external_snark_worker_types.rs index d0c0fd290e..3448c26c76 100644 --- a/node/src/external_snark_worker/external_snark_worker_types.rs +++ b/node/src/external_snark_worker/external_snark_worker_types.rs @@ -1,10 +1,10 @@ use std::sync::Arc; +use mina_core::snark::SnarkJobId; use mina_p2p_messages::v2::{ SnarkWorkerWorkerRpcsVersionedGetWorkV2TResponseA0Instances, TransactionSnarkWorkTStableV2Proofs, }; -use openmina_core::snark::SnarkJobId; pub type SnarkWorkId = SnarkJobId; diff --git a/node/src/external_snark_worker_effectful/external_snark_worker_effectful_actions.rs b/node/src/external_snark_worker_effectful/external_snark_worker_effectful_actions.rs index e493e3d906..7c671d96c3 100644 --- a/node/src/external_snark_worker_effectful/external_snark_worker_effectful_actions.rs +++ b/node/src/external_snark_worker_effectful/external_snark_worker_effectful_actions.rs @@ -1,5 +1,5 @@ +use mina_core::ActionEvent; use mina_p2p_messages::v2::{CurrencyFeeStableV1, NonZeroCurvePoint}; -use openmina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/node/src/ledger/ledger_manager.rs b/node/src/ledger/ledger_manager.rs index 5b407b3113..7773f8ca1d 100644 --- a/node/src/ledger/ledger_manager.rs +++ b/node/src/ledger/ledger_manager.rs @@ -11,9 +11,9 @@ use ledger::{ staged_ledger::staged_ledger::{SkipVerification, StagedLedger}, Account, AccountId, Mask, }; +use mina_core::{channels::mpsc, thread}; use mina_p2p_messages::v2::{self, LedgerHash, MinaBaseAccountBinableArgStableV2}; use mina_signer::CompressedPubKey; -use openmina_core::{channels::mpsc, thread}; use std::collections::BTreeMap; /// The type enumerating different requests that can be made to the @@ -103,7 +103,7 @@ impl LedgerRequest { if let Err(e) = ledger_ctx.staged_ledger_reconstruct(snarked_ledger_hash, parts, cb) { - openmina_core::log::inner::error!( + mina_core::log::inner::error!( "Failed to reconstruct staged ledger: {:?}", e ); diff --git a/node/src/ledger/ledger_reducer.rs b/node/src/ledger/ledger_reducer.rs index 7bdc1b00df..df83f7c678 100644 --- a/node/src/ledger/ledger_reducer.rs +++ b/node/src/ledger/ledger_reducer.rs @@ -21,7 +21,7 @@ impl LedgerState { // TODO(binier): should be a bug condition, but can't be // because we get false positive during testing, since // multiple nodes/ledger run in the same process. - openmina_core::log::warn!( + mina_core::log::warn!( meta.time(); "ledger mask leak: more than 294 ledger masks ({}) detected!", result.alive_masks diff --git a/node/src/ledger/ledger_service.rs b/node/src/ledger/ledger_service.rs index 89af2adb5a..14b3865cfb 100644 --- a/node/src/ledger/ledger_service.rs +++ b/node/src/ledger/ledger_service.rs @@ -47,6 +47,13 @@ use ledger::{ verifier::Verifier, Account, AccountId, AccountIndex, BaseLedger, Database, Mask, TokenId, UnregisterBehavior, }; +use mina_core::{ + block::{AppliedBlock, ArcBlockWithHash}, + bug_condition, + constants::constraint_constants, + snark::{Snark, SnarkJobId}, + thread, +}; use mina_curves::pasta::Fp; use mina_p2p_messages::{ binprot::BinProtRead, @@ -61,13 +68,6 @@ use mina_p2p_messages::{ }, }; use mina_signer::CompressedPubKey; -use openmina_core::{ - block::{AppliedBlock, ArcBlockWithHash}, - bug_condition, - constants::constraint_constants, - snark::{Snark, SnarkJobId}, - thread, -}; use std::{ collections::{BTreeMap, BTreeSet}, path::Path, @@ -177,8 +177,7 @@ pub struct LedgerCtx { sync: LedgerSyncState, /// Returns more data on block application necessary for archive node archive_mode: bool, - event_sender: - Option>, + event_sender: Option>, } #[derive(Default)] @@ -230,7 +229,7 @@ impl LedgerCtx { // reconstruction async, can be removed when the ledger services are made async pub fn set_event_sender( &mut self, - event_sender: openmina_core::channels::mpsc::UnboundedSender, + event_sender: mina_core::channels::mpsc::UnboundedSender, ) { self.event_sender = Some(event_sender); } @@ -418,7 +417,7 @@ impl LedgerCtx { new_root_snarked_ledger_hash: &LedgerHash, new_root_staged_ledger_hash: &MinaBaseStagedLedgerHashStableV1, ) -> Result<(), String> { - openmina_core::debug!(openmina_core::log::system_time(); + mina_core::debug!(mina_core::log::system_time(); kind = "LedgerService::push_snarked_ledger", summary = format!("{old_root_snarked_ledger_hash} -> {new_root_snarked_ledger_hash}")); // Steps 4-7 from https://github.com/openmina/mina/blob/bc812dc9b90e05898c0c36ac76ba51ccf6cac137/src/lib/transition_frontier/full_frontier/full_frontier.ml#L354-L392 @@ -665,7 +664,7 @@ impl LedgerCtx { pred_block: AppliedBlock, skip_verification: Option, ) -> Result { - openmina_core::info!(openmina_core::log::system_time(); + mina_core::info!(mina_core::log::system_time(); kind = "LedgerService::block_apply", summary = format!("{}, {} <- {}", block.height(), block.hash(), block.pred_hash()), pred_staged_ledger_hash = pred_block.merkle_root_hash().to_string(), @@ -723,13 +722,13 @@ impl LedgerCtx { .unwrap(); // We already know the ledger exists, see the same call a few lines above match dump_application_to_file(staged_ledger, block.clone(), pred_block) { - Ok(filename) => openmina_core::info!( - openmina_core::log::system_time(); + Ok(filename) => mina_core::info!( + mina_core::log::system_time(); kind = "LedgerService::dump - Failed application", summary = format!("StagedLedger and block saved to: {filename:?}") ), - Err(e) => openmina_core::error!( - openmina_core::log::system_time(); + Err(e) => mina_core::error!( + mina_core::log::system_time(); kind = "LedgerService::dump - Failed application", summary = format!("Failed to save block application to file: {e:?}") ), @@ -877,7 +876,7 @@ impl LedgerCtx { new_root: &ArcBlockWithHash, new_best_tip: &ArcBlockWithHash, ) -> CommitResult { - openmina_core::debug!(openmina_core::log::system_time(); + mina_core::debug!(mina_core::log::system_time(); kind = "LedgerService::commit", summary = format!("commit {}, {}", new_best_tip.height(), new_best_tip.hash()), new_root = format!("{}, {}", new_root.height(), new_root.hash()), @@ -895,7 +894,7 @@ impl LedgerCtx { self.snarked_ledgers.retain(|hash, _| { let keep = ledgers_to_keep.contains(hash); if !keep { - openmina_core::debug!(openmina_core::log::system_time(); + mina_core::debug!(mina_core::log::system_time(); kind = "LedgerService::commit - snarked_ledgers.drop", summary = format!("drop snarked ledger {hash}")); } @@ -907,7 +906,7 @@ impl LedgerCtx { .filter(|(hash, _)| { let keep = ledgers_to_keep.contains(hash); if !keep { - openmina_core::debug!(openmina_core::log::system_time(); + mina_core::debug!(mina_core::log::system_time(); kind = "LedgerService::commit - snarked_ledgers.drop", summary = format!("drop snarked ledger {hash}")); } @@ -947,7 +946,7 @@ impl LedgerCtx { .map(|mut parent| (merkle_root(&mut parent), parent)) .filter(|(parent_hash, _)| !ledgers_to_keep.contains(parent_hash)) { - openmina_core::debug!(openmina_core::log::system_time(); + mina_core::debug!(mina_core::log::system_time(); kind = "LedgerService::commit - mask.commit_and_reparent", summary = format!("{ledger_hash} -> {parent_hash}")); snarked_ledger.commit(); @@ -1017,7 +1016,7 @@ impl LedgerCtx { (uuid, hash) }) .collect::>(); - openmina_core::debug!(redux::Timestamp::global_now(); "alive_ledgers_after_commit: {alive_ledgers:#?}"); + mina_core::debug!(redux::Timestamp::global_now(); "alive_ledgers_after_commit: {alive_ledgers:#?}"); if !alive.is_empty() { bug_condition!( @@ -1088,8 +1087,8 @@ impl LedgerCtx { ids: Vec, ) -> Vec { let Some((mask, _)) = self.mask(&ledger_hash) else { - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); kind = "LedgerService::get_accounts", summary = format!("Ledger not found: {ledger_hash:?}") ); @@ -1470,8 +1469,8 @@ fn staged_ledger_reconstruct( } Err(_) => { if let Err(e) = dump_reconstruct_to_file(&snarked_ledger, &parts) { - openmina_core::error!( - openmina_core::log::system_time(); + mina_core::error!( + mina_core::log::system_time(); kind = "LedgerService::dump - Failed reconstruct", summary = format!("Failed to save reconstruction to file: {e:?}") ); @@ -1550,7 +1549,7 @@ fn dump_reconstruct_to_file( states: needed_blocks.clone(), }; - let debug_dir = openmina_core::get_debug_dir(); + let debug_dir = mina_core::get_debug_dir(); let filename = debug_dir .join("failed_reconstruct_ctx.binprot") .to_string_lossy() @@ -1562,8 +1561,8 @@ fn dump_reconstruct_to_file( reconstruct_context.binprot_write(&mut file)?; file.sync_all()?; - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "LedgerService::dump - Failed reconstruct", summary = format!("Reconstruction saved to: {filename:?}") ); @@ -1610,7 +1609,7 @@ fn dump_application_to_file( blocks: vec![(*block.block).clone()], }; - let debug_dir = openmina_core::get_debug_dir(); + let debug_dir = mina_core::get_debug_dir(); let filename = debug_dir .join(format!("failed_application_ctx_{}.binprot", block_height)) .to_string_lossy() diff --git a/node/src/ledger/read/ledger_read_reducer.rs b/node/src/ledger/read/ledger_read_reducer.rs index 43d164a2b6..72b76442b6 100644 --- a/node/src/ledger/read/ledger_read_reducer.rs +++ b/node/src/ledger/read/ledger_read_reducer.rs @@ -1,5 +1,5 @@ +use mina_core::{bug_condition, requests::RequestId}; use mina_p2p_messages::v2; -use openmina_core::{bug_condition, requests::RequestId}; use p2p::{ channels::{ rpc::{P2pChannelsRpcAction, P2pRpcId, P2pRpcRequest, P2pRpcResponse}, diff --git a/node/src/ledger/read/ledger_read_state.rs b/node/src/ledger/read/ledger_read_state.rs index df1ce8a880..85badbb06f 100644 --- a/node/src/ledger/read/ledger_read_state.rs +++ b/node/src/ledger/read/ledger_read_state.rs @@ -1,4 +1,4 @@ -use openmina_core::requests::{PendingRequests, RequestId, RequestIdType}; +use mina_core::requests::{PendingRequests, RequestId, RequestIdType}; use serde::{Deserialize, Serialize}; use super::{LedgerReadRequest, LedgerReadResponse}; diff --git a/node/src/ledger/read/mod.rs b/node/src/ledger/read/mod.rs index 0b39ffab8d..29dc7835f4 100644 --- a/node/src/ledger/read/mod.rs +++ b/node/src/ledger/read/mod.rs @@ -4,7 +4,7 @@ pub use ledger_read_actions::*; mod ledger_read_state; pub use ledger_read_state::*; -use openmina_core::{ +use mina_core::{ block::AppliedBlock, requests::{RequestId, RpcId, RpcIdType}, }; diff --git a/node/src/ledger/write/ledger_write_reducer.rs b/node/src/ledger/write/ledger_write_reducer.rs index 5584d36f79..309d622edb 100644 --- a/node/src/ledger/write/ledger_write_reducer.rs +++ b/node/src/ledger/write/ledger_write_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::bug_condition; +use mina_core::bug_condition; use redux::Dispatcher; use crate::{ diff --git a/node/src/ledger/write/mod.rs b/node/src/ledger/write/mod.rs index f69ce1708d..4d9435f5e4 100644 --- a/node/src/ledger/write/mod.rs +++ b/node/src/ledger/write/mod.rs @@ -4,7 +4,7 @@ pub use ledger_write_actions::*; mod ledger_write_state; pub use ledger_write_state::*; -use openmina_core::block::AppliedBlock; +use mina_core::block::AppliedBlock; mod ledger_write_reducer; diff --git a/node/src/ledger_effectful/ledger_effectful_actions.rs b/node/src/ledger_effectful/ledger_effectful_actions.rs index 548b518829..53ec7beda3 100644 --- a/node/src/ledger_effectful/ledger_effectful_actions.rs +++ b/node/src/ledger_effectful/ledger_effectful_actions.rs @@ -2,7 +2,7 @@ use crate::ledger::{ read::{LedgerReadIdType, LedgerReadInitCallback, LedgerReadRequest}, write::LedgerWriteRequest, }; -use openmina_core::requests::RequestId; +use mina_core::requests::RequestId; use redux::Callback; use serde::{Deserialize, Serialize}; diff --git a/node/src/lib.rs b/node/src/lib.rs index 2a96fae397..165a4d6b3a 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -3,7 +3,7 @@ extern crate graphannis_malloc_size_of as malloc_size_of; extern crate graphannis_malloc_size_of_derive as malloc_size_of_derive; -pub use openmina_core as core; +pub use mina_core as core; #[macro_use] mod action; diff --git a/node/src/logger/logger_effects.rs b/node/src/logger/logger_effects.rs index 99dfc05ea8..2de0c657aa 100644 --- a/node/src/logger/logger_effects.rs +++ b/node/src/logger/logger_effects.rs @@ -1,4 +1,4 @@ -use openmina_core::log::{ +use mina_core::log::{ inner::{ field::{display, DisplayValue}, Value, @@ -92,7 +92,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ error: P2pNetworkConnectionError::MioError(summary), addr, } => { - openmina_core::action_debug!( + mina_core::action_debug!( context, kind = "P2pNetworkSchedulerError", summary = display(summary), @@ -129,7 +129,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ TransitionFrontierAction::Candidate( TransitionFrontierCandidateAction::BlockReceived { block, chain_proof }, ) => { - openmina_core::action_info!( + mina_core::action_info!( context, kind = action.kind().to_string(), summary = "candidate block received", @@ -142,7 +142,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ let tip = store.state().transition_frontier.best_tip().unwrap(); if store.state().block_producer.is_produced_by_me(tip) { - openmina_core::action_info!( + mina_core::action_info!( context, kind = "BlockProducerBlockIntegrated", summary = "produced block integrated into frontier", @@ -151,7 +151,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ ); } - openmina_core::action_info!( + mina_core::action_info!( context, kind = action.kind().to_string(), summary = "transition frontier synced", @@ -160,7 +160,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ ); } TransitionFrontierAction::SyncFailed { best_tip, error } => { - openmina_core::action_error!( + mina_core::action_error!( context, kind = action.kind().to_string(), summary = "transition frontier failed to sync", @@ -174,7 +174,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ Action::BlockProducer(a) => match a { BlockProducerAction::BlockProduced => { let block = store.state().block_producer.produced_block().unwrap(); - openmina_core::action_info!( + mina_core::action_info!( context, kind = action.kind().to_string(), summary = "produced a block", @@ -184,7 +184,7 @@ pub fn logger_effects(store: &Store, action: ActionWithMetaRef<'_ } BlockProducerAction::BlockInjected => { let block = store.state().transition_frontier.sync.best_tip().unwrap(); - openmina_core::action_info!( + mina_core::action_info!( context, kind = action.kind().to_string(), summary = "produced block injected", diff --git a/node/src/p2p/callbacks/p2p_callbacks_actions.rs b/node/src/p2p/callbacks/p2p_callbacks_actions.rs index 46fa16c04a..e2ffdcb1f3 100644 --- a/node/src/p2p/callbacks/p2p_callbacks_actions.rs +++ b/node/src/p2p/callbacks/p2p_callbacks_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use p2p::{ channels::{ rpc::{P2pRpcId, P2pRpcRequest, P2pRpcResponse}, diff --git a/node/src/p2p/callbacks/p2p_callbacks_reducer.rs b/node/src/p2p/callbacks/p2p_callbacks_reducer.rs index c0093b33dc..95e8540788 100644 --- a/node/src/p2p/callbacks/p2p_callbacks_reducer.rs +++ b/node/src/p2p/callbacks/p2p_callbacks_reducer.rs @@ -1,13 +1,13 @@ use ark_ff::fields::arithmetic::InvalidBigInt; -use mina_p2p_messages::{ - gossip::GossipNetMessageV2, - v2::{MinaLedgerSyncLedgerAnswerStableV2, StateHash}, -}; -use openmina_core::{ +use mina_core::{ block::{prevalidate::BlockPrevalidationError, BlockWithHash}, bug_condition, log, transaction::TransactionWithHash, }; +use mina_p2p_messages::{ + gossip::GossipNetMessageV2, + v2::{MinaLedgerSyncLedgerAnswerStableV2, StateHash}, +}; use p2p::{ channels::{ best_tip::P2pChannelsBestTipAction, @@ -400,7 +400,7 @@ impl crate::State { .map(|b| b.header().protocol_state.body.try_hash()) .collect::>() else { - openmina_core::error!(meta.time(); "P2pRpcRequest::BestTipWithProof: invalid protocol state"); + mina_core::error!(meta.time(); "P2pRpcRequest::BestTipWithProof: invalid protocol state"); return None; }; @@ -545,7 +545,7 @@ impl crate::State { BlockWithHash::try_new(resp.best_tip.clone()), BlockWithHash::try_new(root_block.clone()), ) else { - openmina_core::error!(meta.time(); "P2pRpcResponse::BestTipWithProof: invalid blocks"); + mina_core::error!(meta.time(); "P2pRpcResponse::BestTipWithProof: invalid blocks"); return; }; @@ -562,7 +562,7 @@ impl crate::State { }) .collect::, _>>() else { - openmina_core::error!(meta.time(); "P2pRpcResponse::BestTipWithProof: invalid hashes"); + mina_core::error!(meta.time(); "P2pRpcResponse::BestTipWithProof: invalid hashes"); return; }; @@ -570,7 +570,7 @@ impl crate::State { let expected_hash = &best_tip.block.header.protocol_state.previous_state_hash; if pred_hash != expected_hash { - openmina_core::warn!(meta.time(); + mina_core::warn!(meta.time(); kind = "P2pRpcBestTipHashMismatch", response = serde_json::to_string(&resp).ok(), expected_hash = expected_hash.to_string(), @@ -631,7 +631,7 @@ impl crate::State { } Some(P2pRpcResponse::Block(block)) => { let Ok(block) = BlockWithHash::try_new(block.clone()) else { - openmina_core::error!(meta.time(); "P2pRpcResponse::Block: invalid block"); + mina_core::error!(meta.time(); "P2pRpcResponse::Block: invalid block"); return; }; dispatcher.push(TransitionFrontierSyncAction::BlocksPeerQuerySuccess { diff --git a/node/src/reducer.rs b/node/src/reducer.rs index 6f64e13e0b..1b358f68de 100644 --- a/node/src/reducer.rs +++ b/node/src/reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, error, Substate}; +use mina_core::{bug_condition, error, Substate}; use p2p::{P2pAction, P2pEffectfulAction, P2pInitializeAction, P2pState}; use crate::{ diff --git a/node/src/rpc/heartbeat.rs b/node/src/rpc/heartbeat.rs index 768033ffce..3cd13c2461 100644 --- a/node/src/rpc/heartbeat.rs +++ b/node/src/rpc/heartbeat.rs @@ -9,7 +9,7 @@ use super::{ RpcNodeStatusTransitionFrontier, }; use crate::{p2p::PeerId, stats::block_producer::BlockProductionAttempt}; -use openmina_node_account::{AccountPublicKey, AccountSecretKey}; +use mina_node_account::{AccountPublicKey, AccountSecretKey}; /// Matches the representation used by o1js where each field is a string /// containing a decimal representation of the field. @@ -153,8 +153,8 @@ impl mina_hasher::Hashable for NodeHeartbeatPayloadDigest { fn domain_string(network_id: Self::D) -> Option { match network_id { - Self::D::MAINNET => openmina_core::network::mainnet::SIGNATURE_PREFIX, - Self::D::TESTNET => openmina_core::network::devnet::SIGNATURE_PREFIX, + Self::D::MAINNET => mina_core::network::mainnet::SIGNATURE_PREFIX, + Self::D::TESTNET => mina_core::network::devnet::SIGNATURE_PREFIX, } .to_string() .into() diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index 113e9672df..7fe0d5047e 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -10,6 +10,11 @@ use ledger::{ transaction_pool::{diff, ValidCommandWithHash}, Account, AccountId, }; +use mina_core::{ + block::{AppliedBlock, ArcBlockWithHash}, + consensus::{ConsensusConstants, ConsensusTime}, +}; +use mina_node_account::AccountPublicKey; use mina_p2p_messages::{ bigint::BigInt, v2::{ @@ -20,11 +25,6 @@ use mina_p2p_messages::{ TransactionSnarkWorkTStableV2, }, }; -use openmina_core::{ - block::{AppliedBlock, ArcBlockWithHash}, - consensus::{ConsensusConstants, ConsensusTime}, -}; -use openmina_node_account::AccountPublicKey; use p2p::bootstrap::P2pNetworkKadBootstrapStats; pub use rpc_state::*; @@ -39,11 +39,11 @@ mod rpc_impls; mod heartbeat; pub use heartbeat::{NodeHeartbeat, ProducedBlockInfo, SignedNodeHeartbeat}; -pub use openmina_core::requests::{RpcId, RpcIdType}; +pub use mina_core::requests::{RpcId, RpcIdType}; use ledger::scan_state::scan_state::{transaction_snark::OneOrTwo, AvailableJobMessage}; +use mina_core::snark::SnarkJobId; use mina_p2p_messages::v2::{CurrencyFeeStableV1, NonZeroCurvePoint}; -use openmina_core::snark::SnarkJobId; use redux::Timestamp; use serde::{Deserialize, Serialize}; diff --git a/node/src/rpc/rpc_actions.rs b/node/src/rpc/rpc_actions.rs index 98fbcee7fe..b987c13ce9 100644 --- a/node/src/rpc/rpc_actions.rs +++ b/node/src/rpc/rpc_actions.rs @@ -2,9 +2,9 @@ use ledger::{ transaction_pool::{diff, ValidCommandWithHash}, Account, AccountId, }; +use mina_core::{block::AppliedBlock, snark::SnarkJobId, ActionEvent}; +use mina_node_account::AccountPublicKey; use mina_p2p_messages::v2::{LedgerHash, MinaBaseUserCommandStableV2, TokenIdKeyHash}; -use openmina_core::{block::AppliedBlock, snark::SnarkJobId, ActionEvent}; -use openmina_node_account::AccountPublicKey; use p2p::PeerId; use serde::{Deserialize, Serialize}; diff --git a/node/src/rpc/rpc_reducer.rs b/node/src/rpc/rpc_reducer.rs index 71933810f8..25fb916f34 100644 --- a/node/src/rpc/rpc_reducer.rs +++ b/node/src/rpc/rpc_reducer.rs @@ -1,14 +1,14 @@ use ledger::scan_state::transaction_logic::valid; -use mina_p2p_messages::v2::{ - MinaBaseSignedCommandStableV2, MinaBaseZkappCommandTStableV1WireStableV1, NonZeroCurvePoint, - TransactionSnarkWorkTStableV2, -}; -use openmina_core::{ +use mina_core::{ block::AppliedBlock, bug_condition, requests::{RequestId, RpcId, RpcIdType}, transaction::{TransactionPoolMessageSource, TransactionWithHash}, }; +use mina_p2p_messages::v2::{ + MinaBaseSignedCommandStableV2, MinaBaseZkappCommandTStableV1WireStableV1, NonZeroCurvePoint, + TransactionSnarkWorkTStableV2, +}; use p2p::{ connection::{incoming::P2pConnectionIncomingAction, outgoing::P2pConnectionOutgoingAction}, webrtc::P2pConnectionResponse, @@ -404,11 +404,11 @@ impl RpcState { let (dispatcher, state) = state_context.into_dispatcher_and_state(); let has_peers = state.p2p.ready_peers_iter().map(|(peer_id, _peer)| { - openmina_core::log::debug!(meta.time(); "found ready peer: {peer_id}") + mina_core::log::debug!(meta.time(); "found ready peer: {peer_id}") }) .next() .ok_or_else(|| { - openmina_core::log::warn!(meta.time(); "no ready peers"); + mina_core::log::warn!(meta.time(); "no ready peers"); String::from("no ready peers") }); diff --git a/node/src/rpc/rpc_state.rs b/node/src/rpc/rpc_state.rs index bffd101a7a..580feffb25 100644 --- a/node/src/rpc/rpc_state.rs +++ b/node/src/rpc/rpc_state.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; +use mina_core::block::AppliedBlock; use mina_p2p_messages::v2; -use openmina_core::block::AppliedBlock; use serde::{Deserialize, Serialize}; use super::{AccountQuery, RpcId, RpcRequest}; diff --git a/node/src/rpc_effectful/rpc_effectful_action.rs b/node/src/rpc_effectful/rpc_effectful_action.rs index 7bc2e07e35..572e0fdaed 100644 --- a/node/src/rpc_effectful/rpc_effectful_action.rs +++ b/node/src/rpc_effectful/rpc_effectful_action.rs @@ -15,10 +15,8 @@ use ledger::{ scan_state::transaction_logic::{valid::UserCommand, zkapp_command::WithHash}, Account, }; +use mina_core::{consensus::ConsensusConstants, requests::RpcId, snark::SnarkJobId, ActionEvent}; use mina_p2p_messages::v2::{self, MinaBaseUserCommandStableV2}; -use openmina_core::{ - consensus::ConsensusConstants, requests::RpcId, snark::SnarkJobId, ActionEvent, -}; use p2p::bootstrap::P2pNetworkKadBootstrapStats; use serde::{Deserialize, Serialize}; diff --git a/node/src/rpc_effectful/rpc_effectful_effects.rs b/node/src/rpc_effectful/rpc_effectful_effects.rs index 1caeae2636..be8ae15c9a 100644 --- a/node/src/rpc_effectful/rpc_effectful_effects.rs +++ b/node/src/rpc_effectful/rpc_effectful_effects.rs @@ -34,10 +34,10 @@ use ledger::{ Account, }; use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; +use mina_core::{block::ArcBlockWithHash, bug_condition}; +use mina_node_account::AccountPublicKey; use mina_p2p_messages::{rpc_kernel::QueryHeader, v2}; use mina_signer::CompressedPubKey; -use openmina_core::{block::ArcBlockWithHash, bug_condition}; -use openmina_node_account::AccountPublicKey; use p2p::channels::streaming_rpc::{ staged_ledger_parts::calc_total_pieces_to_transfer, P2pStreamingRpcReceiveProgress, }; @@ -46,7 +46,7 @@ use redux::ActionWithMeta; macro_rules! respond_or_log { ($e:expr, $t:expr) => { if let Err(err) = $e { - openmina_core::log::warn!($t; "Failed to respond: {err}"); + mina_core::log::warn!($t; "Failed to respond: {err}"); } }; } @@ -606,7 +606,7 @@ pub fn rpc_effects(store: &mut Store, action: ActionWithMeta From<&'a SnarkPoolCandidateState> for openmina_core::snark::SnarkCmp<'a> { +impl<'a> From<&'a SnarkPoolCandidateState> for mina_core::snark::SnarkCmp<'a> { fn from(value: &'a SnarkPoolCandidateState) -> Self { match value { SnarkPoolCandidateState::InfoReceived { info, .. } => info.into(), diff --git a/node/src/snark_pool/snark_pool_actions.rs b/node/src/snark_pool/snark_pool_actions.rs index 6d76e52d1e..35708c26d1 100644 --- a/node/src/snark_pool/snark_pool_actions.rs +++ b/node/src/snark_pool/snark_pool_actions.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use ledger::scan_state::scan_state::{transaction_snark::OneOrTwo, AvailableJobMessage}; -use openmina_core::{ +use mina_core::{ snark::{Snark, SnarkJobCommitment, SnarkJobId}, ActionEvent, }; diff --git a/node/src/snark_pool/snark_pool_reducer.rs b/node/src/snark_pool/snark_pool_reducer.rs index f66207b971..43197c2da3 100644 --- a/node/src/snark_pool/snark_pool_reducer.rs +++ b/node/src/snark_pool/snark_pool_reducer.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; use crate::{snark_pool::JobCommitment, ExternalSnarkWorkerAction, SnarkerStrategy}; -use openmina_core::snark::{SnarkJobCommitment, SnarkJobId}; +use mina_core::snark::{SnarkJobCommitment, SnarkJobId}; use p2p::channels::{ snark::P2pChannelsSnarkAction, snark_job_commitment::P2pChannelsSnarkJobCommitmentAction, }; diff --git a/node/src/snark_pool/snark_pool_state.rs b/node/src/snark_pool/snark_pool_state.rs index e0f30aa36c..8248925213 100644 --- a/node/src/snark_pool/snark_pool_state.rs +++ b/node/src/snark_pool/snark_pool_state.rs @@ -1,7 +1,7 @@ use std::{fmt, ops::RangeBounds, time::Duration}; use ledger::scan_state::scan_state::{transaction_snark::OneOrTwo, AvailableJobMessage}; -use openmina_core::snark::{Snark, SnarkInfo, SnarkJobCommitment, SnarkJobId}; +use mina_core::snark::{Snark, SnarkInfo, SnarkJobCommitment, SnarkJobId}; use redux::Timestamp; use serde::{Deserialize, Serialize}; diff --git a/node/src/state.rs b/node/src/state.rs index b32abbe371..787d67c428 100644 --- a/node/src/state.rs +++ b/node/src/state.rs @@ -1,16 +1,16 @@ use std::{sync::Arc, time::Duration}; use malloc_size_of_derive::MallocSizeOf; -use mina_p2p_messages::v2; -use openmina_core::{ +use mina_core::{ block::prevalidate::{prevalidate_block, BlockPrevalidationError}, consensus::ConsensusTime, transaction::{TransactionInfo, TransactionWithHash}, }; +use mina_p2p_messages::v2; use p2p::P2pNetworkPubsubMessageCacheId; use rand::prelude::*; -use openmina_core::{ +use mina_core::{ block::{ArcBlockWithHash, BlockWithHash}, consensus::ConsensusConstants, constants::constraint_constants, @@ -94,7 +94,7 @@ pub struct State { } // Substate accessors that will be used in reducers -use openmina_core::{bug_condition, impl_substate_access, SubstateAccess}; +use mina_core::{bug_condition, impl_substate_access, SubstateAccess}; impl_substate_access!(State, SnarkState, snark); impl_substate_access!(State, SnarkBlockVerifyState, snark.block_verify); @@ -133,22 +133,22 @@ impl_substate_access!(State, LedgerState, ledger); impl_substate_access!(State, LedgerReadState, ledger.read); impl_substate_access!(State, LedgerWriteState, ledger.write); -impl openmina_core::SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&P2pState> { +impl mina_core::SubstateAccess for State { + fn substate(&self) -> mina_core::SubstateResult<&P2pState> { self.p2p .ready() .ok_or_else(|| "P2P state unavailable. P2P layer is not ready".to_owned()) } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut P2pState> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut P2pState> { self.p2p .ready_mut() .ok_or_else(|| "P2P state unavailable. P2P layer is not ready".to_owned()) } } -impl openmina_core::SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&TransitionFrontierSyncLedgerState> { +impl mina_core::SubstateAccess for State { + fn substate(&self) -> mina_core::SubstateResult<&TransitionFrontierSyncLedgerState> { self.transition_frontier .sync .ledger() @@ -157,7 +157,7 @@ impl openmina_core::SubstateAccess for State fn substate_mut( &mut self, - ) -> openmina_core::SubstateResult<&mut TransitionFrontierSyncLedgerState> { + ) -> mina_core::SubstateResult<&mut TransitionFrontierSyncLedgerState> { self.transition_frontier .sync .ledger_mut() @@ -166,16 +166,14 @@ impl openmina_core::SubstateAccess for State } impl SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&BlockProducerVrfEvaluatorState> { + fn substate(&self) -> mina_core::SubstateResult<&BlockProducerVrfEvaluatorState> { self.block_producer .as_ref() .map(|state| &state.vrf_evaluator) .ok_or_else(|| "Block producer VRF evaluator state unavailable".to_owned()) } - fn substate_mut( - &mut self, - ) -> openmina_core::SubstateResult<&mut BlockProducerVrfEvaluatorState> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut BlockProducerVrfEvaluatorState> { self.block_producer .as_mut() .map(|state| &mut state.vrf_evaluator) @@ -183,8 +181,8 @@ impl SubstateAccess for State { } } -impl openmina_core::SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&TransitionFrontierSyncLedgerSnarkedState> { +impl mina_core::SubstateAccess for State { + fn substate(&self) -> mina_core::SubstateResult<&TransitionFrontierSyncLedgerSnarkedState> { self.transition_frontier .sync .ledger() @@ -197,7 +195,7 @@ impl openmina_core::SubstateAccess for fn substate_mut( &mut self, - ) -> openmina_core::SubstateResult<&mut TransitionFrontierSyncLedgerSnarkedState> { + ) -> mina_core::SubstateResult<&mut TransitionFrontierSyncLedgerSnarkedState> { self.transition_frontier .sync .ledger_mut() @@ -209,8 +207,8 @@ impl openmina_core::SubstateAccess for } } -impl openmina_core::SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&TransitionFrontierSyncLedgerStagedState> { +impl mina_core::SubstateAccess for State { + fn substate(&self) -> mina_core::SubstateResult<&TransitionFrontierSyncLedgerStagedState> { self.transition_frontier .sync .ledger() @@ -223,7 +221,7 @@ impl openmina_core::SubstateAccess for fn substate_mut( &mut self, - ) -> openmina_core::SubstateResult<&mut TransitionFrontierSyncLedgerStagedState> { + ) -> mina_core::SubstateResult<&mut TransitionFrontierSyncLedgerStagedState> { self.transition_frontier .sync .ledger_mut() @@ -236,24 +234,24 @@ impl openmina_core::SubstateAccess for } impl SubstateAccess for State { - fn substate(&self) -> openmina_core::SubstateResult<&State> { + fn substate(&self) -> mina_core::SubstateResult<&State> { Ok(self) } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut State> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut State> { Ok(self) } } macro_rules! impl_p2p_state_access { ($state:ty, $substate_type:ty) => { - impl openmina_core::SubstateAccess<$substate_type> for $state { - fn substate(&self) -> openmina_core::SubstateResult<&$substate_type> { + impl mina_core::SubstateAccess<$substate_type> for $state { + fn substate(&self) -> mina_core::SubstateResult<&$substate_type> { let substate: &P2pState = self.substate()?; substate.substate() } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut $substate_type> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut $substate_type> { let substate: &mut P2pState = self.substate_mut()?; substate.substate_mut() } @@ -272,7 +270,7 @@ impl_p2p_state_access!(State, p2p::P2pConfig); impl p2p::P2pStateTrait for State {} -pub type Substate<'a, S> = openmina_core::Substate<'a, crate::Action, State, S>; +pub type Substate<'a, S> = mina_core::Substate<'a, crate::Action, State, S>; impl State { pub fn new(config: Config, constants: &ConsensusConstants, now: Timestamp) -> Self { @@ -483,7 +481,7 @@ macro_rules! p2p_ready { Some(v) => v, None => { //panic!("p2p is not ready: {:?}\nline: {}", $reason, line!()); - openmina_core::error!($time; "p2p is not initialized: {}", $reason); + mina_core::error!($time; "p2p is not initialized: {}", $reason); return; } } diff --git a/node/src/stats/mod.rs b/node/src/stats/mod.rs index 671e007e95..031652e0f3 100644 --- a/node/src/stats/mod.rs +++ b/node/src/stats/mod.rs @@ -16,7 +16,7 @@ pub mod block_producer { } use block_producer::BlockProducerStats; -use openmina_core::block::{AppliedBlock, ArcBlockWithHash}; +use mina_core::block::{AppliedBlock, ArcBlockWithHash}; use redux::{ActionMeta, ActionWithMeta, Timestamp}; use crate::{ diff --git a/node/src/stats/stats_block_producer.rs b/node/src/stats/stats_block_producer.rs index e0c7785612..a5147bdd67 100644 --- a/node/src/stats/stats_block_producer.rs +++ b/node/src/stats/stats_block_producer.rs @@ -1,8 +1,8 @@ use std::collections::{BTreeMap, VecDeque}; use ledger::AccountIndex; +use mina_core::block::{AppliedBlock, ArcBlockWithHash}; use mina_p2p_messages::v2; -use openmina_core::block::{AppliedBlock, ArcBlockWithHash}; use serde::{Deserialize, Serialize}; use crate::{ @@ -169,7 +169,7 @@ impl BlockProducerStats { { match self.attempts.pop_back() { None => { - openmina_core::log::error!(openmina_core::log::system_time(); + mina_core::log::error!(mina_core::log::system_time(); kind = "BlockProducerStatsAttemptsEmpty", summary = "attempts are empty when they aren't expected to be", update_kind = kind); @@ -178,7 +178,7 @@ impl BlockProducerStats { let was_correct_state = with(&mut attempt); if !was_correct_state { - openmina_core::log::error!(openmina_core::log::system_time(); + mina_core::log::error!(mina_core::log::system_time(); kind = "BlockProducerStatsAttemptUnexpectedState", summary = format!("update kind `{kind}` is not applicable to state: {attempt:?}")); } @@ -395,7 +395,7 @@ impl From<(&BlockHash, &BlockWithoutProof)> for ProducedBlock { transactions: block.into(), completed_works_count: block.body.completed_works_count(), coinbase: if block.body.has_coinbase() { - openmina_core::constants::constraint_constants().coinbase_amount + mina_core::constants::constraint_constants().coinbase_amount } else { 0 }, diff --git a/node/src/stats/stats_sync.rs b/node/src/stats/stats_sync.rs index 99143e571c..503c9d9259 100644 --- a/node/src/stats/stats_sync.rs +++ b/node/src/stats/stats_sync.rs @@ -1,7 +1,7 @@ use std::collections::VecDeque; +use mina_core::block::ArcBlockWithHash; use mina_p2p_messages::v2::{LedgerHash, StateHash}; -use openmina_core::block::ArcBlockWithHash; use redux::Timestamp; use serde::{Deserialize, Serialize}; diff --git a/node/src/transaction_pool/candidate/transaction_pool_candidate_actions.rs b/node/src/transaction_pool/candidate/transaction_pool_candidate_actions.rs index 0dbf04dcb2..340e5441d8 100644 --- a/node/src/transaction_pool/candidate/transaction_pool_candidate_actions.rs +++ b/node/src/transaction_pool/candidate/transaction_pool_candidate_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{ +use mina_core::{ transaction::{ TransactionHash, TransactionInfo, TransactionPoolMessageSource, TransactionWithHash, }, diff --git a/node/src/transaction_pool/candidate/transaction_pool_candidate_state.rs b/node/src/transaction_pool/candidate/transaction_pool_candidate_state.rs index d6625889ae..8cea409f41 100644 --- a/node/src/transaction_pool/candidate/transaction_pool_candidate_state.rs +++ b/node/src/transaction_pool/candidate/transaction_pool_candidate_state.rs @@ -2,8 +2,8 @@ use std::collections::{BTreeMap, BTreeSet}; +use mina_core::transaction::TransactionPoolMessageSource; use mina_p2p_messages::v2; -use openmina_core::transaction::TransactionPoolMessageSource; use p2p::P2pNetworkPubsubMessageCacheId; use redux::Timestamp; use serde::{Deserialize, Serialize}; @@ -395,7 +395,7 @@ impl TransactionPoolCandidatesState { // TODO(binier) match transaction.hash() { Err(err) => { - openmina_core::bug_condition!("tx hashing failed: {err}"); + mina_core::bug_condition!("tx hashing failed: {err}"); } Ok(hash) => self.transaction_remove(&hash), }; diff --git a/node/src/transaction_pool/transaction_pool_actions.rs b/node/src/transaction_pool/transaction_pool_actions.rs index 181d9b2217..6ea9c4930d 100644 --- a/node/src/transaction_pool/transaction_pool_actions.rs +++ b/node/src/transaction_pool/transaction_pool_actions.rs @@ -8,14 +8,14 @@ use ledger::{ }, Account, AccountId, }; +use mina_core::{ + transaction::{TransactionPoolMessageSource, TransactionWithHash}, + ActionEvent, +}; use mina_p2p_messages::{ list::List, v2::{self}, }; -use openmina_core::{ - transaction::{TransactionPoolMessageSource, TransactionWithHash}, - ActionEvent, -}; use redux::Callback; use serde::{Deserialize, Serialize}; diff --git a/node/src/transaction_pool/transaction_pool_effects.rs b/node/src/transaction_pool/transaction_pool_effects.rs index c9095c3a3f..62b8e1782c 100644 --- a/node/src/transaction_pool/transaction_pool_effects.rs +++ b/node/src/transaction_pool/transaction_pool_effects.rs @@ -18,8 +18,8 @@ impl TransactionPoolEffectfulAction { pending_id, from_source, } => { - openmina_core::log::info!( - openmina_core::log::system_time(); + mina_core::log::info!( + mina_core::log::system_time(); kind = "TransactionPoolEffectfulFetchAccounts", summary = "fetching accounts for tx pool"); // FIXME: the ledger ctx `get_accounts` function doesn't ensure that every account we @@ -34,8 +34,8 @@ impl TransactionPoolEffectfulAction { { Ok(accounts) => accounts, Err(err) => { - openmina_core::log::error!( - openmina_core::log::system_time(); + mina_core::log::error!( + mina_core::log::system_time(); kind = "Error", summary = "failed to fetch accounts for tx pool", error = format!("ledger {:?}, error: {:?}", ledger_hash, err)); diff --git a/node/src/transaction_pool/transaction_pool_reducer.rs b/node/src/transaction_pool/transaction_pool_reducer.rs index fa7fd22e20..f5b04e81f9 100644 --- a/node/src/transaction_pool/transaction_pool_reducer.rs +++ b/node/src/transaction_pool/transaction_pool_reducer.rs @@ -6,7 +6,7 @@ use ledger::{ }, Account, AccountId, }; -use openmina_core::{ +use mina_core::{ bug_condition, constants::constraint_constants, transaction::{Transaction, TransactionPoolMessageSource, TransactionWithHash}, @@ -54,7 +54,7 @@ impl TransactionPoolState { match action { TransactionPoolAction::Candidate(a) => { super::candidate::TransactionPoolCandidatesState::reducer( - openmina_core::Substate::from_compatible_substate(state), + mina_core::Substate::from_compatible_substate(state), meta.with_action(a), ); } diff --git a/node/src/transaction_pool/transaction_pool_state.rs b/node/src/transaction_pool/transaction_pool_state.rs index bb23519c70..9e2e816f7c 100644 --- a/node/src/transaction_pool/transaction_pool_state.rs +++ b/node/src/transaction_pool/transaction_pool_state.rs @@ -6,8 +6,8 @@ use ledger::{ transaction_pool::{Config, ValidCommandWithHash}, AccountId, }; +use mina_core::{consensus::ConsensusConstants, distributed_pool::DistributedPool}; use mina_p2p_messages::v2::{self, TransactionHash}; -use openmina_core::{consensus::ConsensusConstants, distributed_pool::DistributedPool}; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, HashMap}; diff --git a/node/src/transition_frontier/candidate/transition_frontier_candidate_actions.rs b/node/src/transition_frontier/candidate/transition_frontier_candidate_actions.rs index 1f90002d2c..2eb43f45ec 100644 --- a/node/src/transition_frontier/candidate/transition_frontier_candidate_actions.rs +++ b/node/src/transition_frontier/candidate/transition_frontier_candidate_actions.rs @@ -1,10 +1,10 @@ -use mina_p2p_messages::v2::StateHash; -use openmina_core::{ +use mina_core::{ action_event, block::{prevalidate::BlockPrevalidationError, ArcBlockWithHash}, consensus::consensus_take, ActionEvent, }; +use mina_p2p_messages::v2::StateHash; use serde::{Deserialize, Serialize}; use snark::block_verify::SnarkBlockVerifyError; diff --git a/node/src/transition_frontier/candidate/transition_frontier_candidate_reducer.rs b/node/src/transition_frontier/candidate/transition_frontier_candidate_reducer.rs index a00b040f77..131d54389b 100644 --- a/node/src/transition_frontier/candidate/transition_frontier_candidate_reducer.rs +++ b/node/src/transition_frontier/candidate/transition_frontier_candidate_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{ +use mina_core::{ block::{ArcBlockWithHash, BlockHash}, bug_condition, }; diff --git a/node/src/transition_frontier/candidate/transition_frontier_candidate_state.rs b/node/src/transition_frontier/candidate/transition_frontier_candidate_state.rs index 48b7526706..23e6e42864 100644 --- a/node/src/transition_frontier/candidate/transition_frontier_candidate_state.rs +++ b/node/src/transition_frontier/candidate/transition_frontier_candidate_state.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, BTreeSet}; use mina_p2p_messages::v2::StateHash; use serde::{Deserialize, Serialize}; -use openmina_core::{ +use mina_core::{ block::ArcBlockWithHash, consensus::{ consensus_take, ConsensusLongRangeForkDecisionReason, ConsensusShortRangeForkDecisionReason, diff --git a/node/src/transition_frontier/genesis/mod.rs b/node/src/transition_frontier/genesis/mod.rs index 53d7b1be86..8132737452 100644 --- a/node/src/transition_frontier/genesis/mod.rs +++ b/node/src/transition_frontier/genesis/mod.rs @@ -10,8 +10,8 @@ pub use transition_frontier_genesis_actions::*; mod transition_frontier_genesis_reducer; use ledger::scan_state::pending_coinbase::PendingCoinbase; +use mina_core::constants::constraint_constants; use mina_p2p_messages::v2; -use openmina_core::constants::constraint_constants; pub(super) fn empty_block_body() -> v2::StagedLedgerDiffDiffStableV2 { use ledger::staged_ledger::diff::with_valid_signatures_and_proofs::Diff; diff --git a/node/src/transition_frontier/genesis/transition_frontier_genesis_actions.rs b/node/src/transition_frontier/genesis/transition_frontier_genesis_actions.rs index c9d370da60..cf0e1942aa 100644 --- a/node/src/transition_frontier/genesis/transition_frontier_genesis_actions.rs +++ b/node/src/transition_frontier/genesis/transition_frontier_genesis_actions.rs @@ -1,7 +1,7 @@ use std::sync::Arc; +use mina_core::ActionEvent; use mina_p2p_messages::v2; -use openmina_core::ActionEvent; use serde::{Deserialize, Serialize}; use super::{GenesisConfigLoaded, TransitionFrontierGenesisState}; diff --git a/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs b/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs index e91f215344..a6fc7d55b2 100644 --- a/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs +++ b/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs @@ -9,10 +9,11 @@ use std::{ use crate::{account::AccountSecretKey, daemon_json::EpochData}; use ark_ff::fields::arithmetic::InvalidBigInt; use ledger::{ - proofs::caching::{ensure_path_exists, openmina_cache_path}, + proofs::caching::{ensure_path_exists, mina_cache_path}, scan_state::currency::Balance, BaseLedger, }; +use mina_core::constants::{constraint_constants, DEFAULT_GENESIS_TIMESTAMP_MILLISECONDS}; use mina_curves::pasta::Fp; use mina_p2p_messages::{ binprot::{ @@ -22,7 +23,6 @@ use mina_p2p_messages::{ }, v2::{self, PROTOCOL_CONSTANTS}, }; -use openmina_core::constants::{constraint_constants, DEFAULT_GENESIS_TIMESTAMP_MILLISECONDS}; use serde::{Deserialize, Serialize}; use crate::{ @@ -364,8 +364,8 @@ impl GenesisConfig { ledger_name: String, accounts: impl Iterator, ) -> Result<(ledger::Mask, v2::CurrencyAmountStableV1, LedgerHash), GenesisConfigError> { - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "ledger loading", message = "loading the ledger", ledger_name = ledger_name, @@ -383,8 +383,8 @@ impl GenesisConfig { .map(|(n, h)| Ok((n, h.to_field()?))) .collect::, InvalidBigInt>>()?, )?; - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "ledger loaded", message = "loaded from cache", ledger_hash = accounts_with_hash.ledger_hash.to_string(), @@ -408,8 +408,8 @@ impl GenesisConfig { .collect(), }; ledger_accounts.cache()?; - openmina_core::info!( - openmina_core::log::system_time(); + mina_core::info!( + mina_core::log::system_time(); kind = "ledger loaded", message = "built from config and cached", ledger_hash = hash.to_string(), @@ -561,7 +561,7 @@ struct LedgerAccountsWithHash { impl LedgerAccountsWithHash { fn cache(&self) -> Result<(), std::io::Error> { - let cache_dir = openmina_cache_path("ledgers").unwrap(); + let cache_dir = mina_cache_path("ledgers").unwrap(); let cache_file = cache_dir.join(format!("{}.bin", self.ledger_hash)); ensure_path_exists(cache_dir)?; let mut file = File::create(cache_file)?; @@ -569,7 +569,7 @@ impl LedgerAccountsWithHash { } fn load(ledger_name: String) -> Result, binprot::Error> { - let cache_filename = openmina_cache_path(format!("ledgers/{}.bin", ledger_name)).unwrap(); + let cache_filename = mina_cache_path(format!("ledgers/{}.bin", ledger_name)).unwrap(); if cache_filename.is_file() { let mut file = File::open(cache_filename)?; LedgerAccountsWithHash::binprot_read(&mut file).map(Some) diff --git a/node/src/transition_frontier/genesis/transition_frontier_genesis_reducer.rs b/node/src/transition_frontier/genesis/transition_frontier_genesis_reducer.rs index e35b62deec..10f48fdd55 100644 --- a/node/src/transition_frontier/genesis/transition_frontier_genesis_reducer.rs +++ b/node/src/transition_frontier/genesis/transition_frontier_genesis_reducer.rs @@ -5,12 +5,12 @@ use crate::{ use ledger::{ dummy::dummy_blockchain_proof, scan_state::transaction_logic::local_state::LocalState, }; -use mina_p2p_messages::v2; -use openmina_core::{ +use mina_core::{ block::{genesis::genesis_and_negative_one_protocol_states, BlockWithHash}, constants::PROTOCOL_VERSION, error, }; +use mina_p2p_messages::v2; use p2p::P2pInitializeAction; use super::{ @@ -104,9 +104,9 @@ impl TransitionFrontierGenesisState { error!(meta.time(); "incorrect state: {:?}", global_state.transition_frontier.genesis); return; }; - use openmina_core::{constants, ChainId}; + use mina_core::{constants, ChainId}; let constraint_system_digests = - openmina_core::NetworkConfig::global().constraint_system_digests; + mina_core::NetworkConfig::global().constraint_system_digests; let chain_id = ChainId::compute( constraint_system_digests, genesis_hash, diff --git a/node/src/transition_frontier/genesis/transition_frontier_genesis_state.rs b/node/src/transition_frontier/genesis/transition_frontier_genesis_state.rs index f6e07cf2c5..985b79d863 100644 --- a/node/src/transition_frontier/genesis/transition_frontier_genesis_state.rs +++ b/node/src/transition_frontier/genesis/transition_frontier_genesis_state.rs @@ -1,6 +1,6 @@ use ledger::dummy::dummy_blockchain_proof; +use mina_core::{block::ArcBlockWithHash, constants::PROTOCOL_VERSION}; use mina_p2p_messages::v2; -use openmina_core::{block::ArcBlockWithHash, constants::PROTOCOL_VERSION}; use serde::{Deserialize, Serialize}; use super::{empty_block_body, GenesisConfigLoaded}; diff --git a/node/src/transition_frontier/genesis_effectful/transition_frontier_genesis_effectful_actions.rs b/node/src/transition_frontier/genesis_effectful/transition_frontier_genesis_effectful_actions.rs index ec7f088fa9..c1e7d18129 100644 --- a/node/src/transition_frontier/genesis_effectful/transition_frontier_genesis_effectful_actions.rs +++ b/node/src/transition_frontier/genesis_effectful/transition_frontier_genesis_effectful_actions.rs @@ -1,7 +1,7 @@ use std::sync::Arc; +use mina_core::ActionEvent; use mina_p2p_messages::v2::{ProverExtendBlockchainInputStableV2, StateHash}; -use openmina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::transition_frontier::genesis::GenesisConfig; diff --git a/node/src/transition_frontier/sync/ledger/mod.rs b/node/src/transition_frontier/sync/ledger/mod.rs index 7c5eb4dcdb..7392039dc8 100644 --- a/node/src/transition_frontier/sync/ledger/mod.rs +++ b/node/src/transition_frontier/sync/ledger/mod.rs @@ -12,8 +12,8 @@ mod transition_frontier_sync_ledger_reducer; mod transition_frontier_sync_ledger_effects; pub use transition_frontier_sync_ledger_effects::*; +use mina_core::block::ArcBlockWithHash; use mina_p2p_messages::v2::{LedgerHash, MinaBaseStagedLedgerHashStableV1, StateHash}; -use openmina_core::block::ArcBlockWithHash; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, Copy)] diff --git a/node/src/transition_frontier/sync/ledger/snarked/transition_frontier_sync_ledger_snarked_actions.rs b/node/src/transition_frontier/sync/ledger/snarked/transition_frontier_sync_ledger_snarked_actions.rs index 7257af0952..ef71ec3d93 100644 --- a/node/src/transition_frontier/sync/ledger/snarked/transition_frontier_sync_ledger_snarked_actions.rs +++ b/node/src/transition_frontier/sync/ledger/snarked/transition_frontier_sync_ledger_snarked_actions.rs @@ -1,5 +1,5 @@ +use mina_core::ActionEvent; use mina_p2p_messages::v2::{LedgerHash, MinaBaseAccountBinableArgStableV2}; -use openmina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{ @@ -458,7 +458,7 @@ impl redux::EnablingCondition for TransitionFrontierSyncLedgerSnar fn check_peer_available( peer: &p2p::P2pPeerStatusReady, target: &crate::transition_frontier::sync::ledger::SyncLedgerTarget, - target_best_tip: &openmina_core::block::BlockWithHash< + target_best_tip: &mina_core::block::BlockWithHash< std::sync::Arc, >, ) -> bool { diff --git a/node/src/transition_frontier/sync/ledger/staged/transition_frontier_sync_ledger_staged_actions.rs b/node/src/transition_frontier/sync/ledger/staged/transition_frontier_sync_ledger_staged_actions.rs index f17cd0f4f1..227f9d1466 100644 --- a/node/src/transition_frontier/sync/ledger/staged/transition_frontier_sync_ledger_staged_actions.rs +++ b/node/src/transition_frontier/sync/ledger/staged/transition_frontier_sync_ledger_staged_actions.rs @@ -1,7 +1,7 @@ use std::sync::Arc; +use mina_core::ActionEvent; use mina_p2p_messages::v2::{self, LedgerHash}; -use openmina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/node/src/transition_frontier/sync/ledger/transition_frontier_sync_ledger_actions.rs b/node/src/transition_frontier/sync/ledger/transition_frontier_sync_ledger_actions.rs index daf5aaca38..e7a04cd93c 100644 --- a/node/src/transition_frontier/sync/ledger/transition_frontier_sync_ledger_actions.rs +++ b/node/src/transition_frontier/sync/ledger/transition_frontier_sync_ledger_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{transition_frontier::sync::TransitionFrontierSyncAction, TransitionFrontierAction}; diff --git a/node/src/transition_frontier/sync/mod.rs b/node/src/transition_frontier/sync/mod.rs index 0bf4b1c16b..6e74e8c684 100644 --- a/node/src/transition_frontier/sync/mod.rs +++ b/node/src/transition_frontier/sync/mod.rs @@ -10,7 +10,7 @@ mod transition_frontier_sync_reducer; mod transition_frontier_sync_effects; -use openmina_core::block::ArcBlockWithHash; +use mina_core::block::ArcBlockWithHash; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/node/src/transition_frontier/sync/transition_frontier_sync_actions.rs b/node/src/transition_frontier/sync/transition_frontier_sync_actions.rs index 2d71d09064..3c0229a995 100644 --- a/node/src/transition_frontier/sync/transition_frontier_sync_actions.rs +++ b/node/src/transition_frontier/sync/transition_frontier_sync_actions.rs @@ -1,5 +1,5 @@ +use mina_core::{block::ArcBlockWithHash, consensus::consensus_take, ActionEvent}; use mina_p2p_messages::v2::{LedgerHash, StateHash}; -use openmina_core::{block::ArcBlockWithHash, consensus::consensus_take, ActionEvent}; use redux::Callback; use serde::{Deserialize, Serialize}; diff --git a/node/src/transition_frontier/sync/transition_frontier_sync_effects.rs b/node/src/transition_frontier/sync/transition_frontier_sync_effects.rs index 7cadf917b6..ed723d9063 100644 --- a/node/src/transition_frontier/sync/transition_frontier_sync_effects.rs +++ b/node/src/transition_frontier/sync/transition_frontier_sync_effects.rs @@ -1,5 +1,5 @@ +use mina_core::block::{AppliedBlock, ArcBlockWithHash}; use mina_p2p_messages::v2::LedgerHash; -use openmina_core::block::{AppliedBlock, ArcBlockWithHash}; use p2p::{ channels::rpc::{P2pChannelsRpcAction, P2pRpcId}, P2pNetworkPubsubAction, PeerId, diff --git a/node/src/transition_frontier/sync/transition_frontier_sync_reducer.rs b/node/src/transition_frontier/sync/transition_frontier_sync_reducer.rs index bb0ea5ac04..3dbe51f0bd 100644 --- a/node/src/transition_frontier/sync/transition_frontier_sync_reducer.rs +++ b/node/src/transition_frontier/sync/transition_frontier_sync_reducer.rs @@ -1,7 +1,7 @@ use std::collections::{BTreeMap, VecDeque}; +use mina_core::block::{AppliedBlock, ArcBlockWithHash}; use mina_p2p_messages::v2::StateHash; -use openmina_core::block::{AppliedBlock, ArcBlockWithHash}; use super::{ ledger::{ diff --git a/node/src/transition_frontier/sync/transition_frontier_sync_state.rs b/node/src/transition_frontier/sync/transition_frontier_sync_state.rs index 031daec0af..db04bbd86a 100644 --- a/node/src/transition_frontier/sync/transition_frontier_sync_state.rs +++ b/node/src/transition_frontier/sync/transition_frontier_sync_state.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; +use mina_core::block::{AppliedBlock, ArcBlockWithHash}; use mina_p2p_messages::v2::{self, LedgerHash, MinaStateProtocolStateValueStableV2, StateHash}; -use openmina_core::block::{AppliedBlock, ArcBlockWithHash}; use redux::Timestamp; use serde::{Deserialize, Serialize}; use strum_macros::Display; diff --git a/node/src/transition_frontier/transition_frontier_actions.rs b/node/src/transition_frontier/transition_frontier_actions.rs index 44ead62391..caecf4cc0a 100644 --- a/node/src/transition_frontier/transition_frontier_actions.rs +++ b/node/src/transition_frontier/transition_frontier_actions.rs @@ -1,7 +1,7 @@ use std::{collections::BTreeSet, sync::Arc}; +use mina_core::{block::ArcBlockWithHash, ActionEvent}; use mina_p2p_messages::v2::StateHash; -use openmina_core::{block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; use super::{ diff --git a/node/src/transition_frontier/transition_frontier_reducer.rs b/node/src/transition_frontier/transition_frontier_reducer.rs index 8551cce166..d791dd22ca 100644 --- a/node/src/transition_frontier/transition_frontier_reducer.rs +++ b/node/src/transition_frontier/transition_frontier_reducer.rs @@ -2,7 +2,7 @@ use super::{ sync::{SyncError, TransitionFrontierSyncState}, TransitionFrontierAction, TransitionFrontierActionWithMetaRef, TransitionFrontierState, }; -use openmina_core::block::AppliedBlock; +use mina_core::block::AppliedBlock; impl TransitionFrontierState { pub fn reducer( @@ -21,7 +21,7 @@ impl TransitionFrontierState { match action { TransitionFrontierAction::Genesis(a) => { super::genesis::TransitionFrontierGenesisState::reducer( - openmina_core::Substate::from_compatible_substate(state_context), + mina_core::Substate::from_compatible_substate(state_context), meta.with_action(a), ) } @@ -56,14 +56,14 @@ impl TransitionFrontierState { } TransitionFrontierAction::Candidate(a) => { super::candidate::TransitionFrontierCandidatesState::reducer( - openmina_core::Substate::from_compatible_substate(state_context), + mina_core::Substate::from_compatible_substate(state_context), meta.with_action(a), ); } TransitionFrontierAction::Sync(a) => { let best_chain = state.best_chain.clone(); super::sync::TransitionFrontierSyncState::reducer( - openmina_core::Substate::from_compatible_substate(state_context), + mina_core::Substate::from_compatible_substate(state_context), meta.with_action(a), &best_chain, ); diff --git a/node/src/transition_frontier/transition_frontier_state.rs b/node/src/transition_frontier/transition_frontier_state.rs index 00753eb365..dbbc47ebe2 100644 --- a/node/src/transition_frontier/transition_frontier_state.rs +++ b/node/src/transition_frontier/transition_frontier_state.rs @@ -1,14 +1,14 @@ use std::collections::BTreeMap; use ledger::transaction_pool::diff::BestTipDiff; +use mina_core::{ + block::{AppliedBlock, ArcBlockWithHash}, + bug_condition, +}; use mina_p2p_messages::v2::{ MinaStateProtocolStateBodyValueStableV2, MinaStateProtocolStateValueStableV2, StateHash, TransactionHash, }; -use openmina_core::{ - block::{AppliedBlock, ArcBlockWithHash}, - bug_condition, -}; use serde::{Deserialize, Serialize}; use super::{ diff --git a/node/src/watched_accounts/watched_accounts_actions.rs b/node/src/watched_accounts/watched_accounts_actions.rs index ca23a67420..80e92a86a8 100644 --- a/node/src/watched_accounts/watched_accounts_actions.rs +++ b/node/src/watched_accounts/watched_accounts_actions.rs @@ -1,9 +1,9 @@ use std::sync::Arc; +use mina_core::block::BlockWithHash; use mina_p2p_messages::v2::{ MinaBaseAccountBinableArgStableV2, MinaBlockBlockStableV2, NonZeroCurvePoint, StateHash, }; -use openmina_core::block::BlockWithHash; use serde::{Deserialize, Serialize}; use crate::p2p::PeerId; diff --git a/node/testing/Cargo.toml b/node/testing/Cargo.toml index 06e9613d8d..92408aad03 100644 --- a/node/testing/Cargo.toml +++ b/node/testing/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "openmina-node-testing" +name = "mina-node-testing" version = "0.16.0" edition = "2021" license = "Apache-2.0" [lib] -name = "openmina_node_testing" +name = "mina_node_testing" path = "src/lib.rs" [[bin]] -name = "openmina-node-testing" +name = "mina-node-testing" path = "src/main.rs" [dependencies] @@ -65,10 +65,10 @@ nix = { version = "0.27.1", features = ["process", "signal"] } reqwest = { version = "0.11.22", features = ["blocking", "json"] } temp-dir = "0.1.11" +mina-core = { path = "../../core" } +mina-node-invariants = { path = "../../node/invariants" } +mina-node-native = { path = "../../node/native" } node = { path = "../../node" } -openmina-core = { path = "../../core" } -openmina-node-invariants = { path = "../../node/invariants" } -openmina-node-native = { path = "../../node/native" } [target.'cfg(not(target_family = "wasm"))'.dependencies] redux = { workspace = true, features = ["serializable_callbacks"] } @@ -81,5 +81,5 @@ libp2p-identity = { version = "=0.2.7", features = [ [features] default = ["p2p-libp2p", "scenario-generators"] scenario-generators = ["documented"] -p2p-webrtc = ["openmina-node-native/p2p-webrtc"] -p2p-libp2p = ["openmina-node-native/p2p-libp2p"] +p2p-webrtc = ["mina-node-native/p2p-webrtc"] +p2p-libp2p = ["mina-node-native/p2p-libp2p"] diff --git a/node/testing/docker/Dockerfile.openmina b/node/testing/docker/Dockerfile.mina similarity index 100% rename from node/testing/docker/Dockerfile.openmina rename to node/testing/docker/Dockerfile.mina diff --git a/node/testing/src/cluster/mod.rs b/node/testing/src/cluster/mod.rs index e6754befb9..c79745e3b0 100644 --- a/node/testing/src/cluster/mod.rs +++ b/node/testing/src/cluster/mod.rs @@ -4,8 +4,8 @@ pub use config::{ClusterConfig, ProofKind}; mod p2p_task_spawner; mod node_id; +use mina_core::channels::Aborter; pub use node_id::{ClusterNodeId, ClusterOcamlNodeId}; -use openmina_core::channels::Aborter; pub mod runner; @@ -20,6 +20,8 @@ use std::{ use libp2p::futures::{stream::FuturesUnordered, StreamExt}; use ledger::proofs::provers::BlockProver; +use mina_node_invariants::{InvariantResult, Invariants}; +use mina_node_native::{http_server, NodeServiceBuilder}; use node::{ account::{AccountPublicKey, AccountSecretKey}, core::{ @@ -36,8 +38,6 @@ use node::{ BuildEnv, Config, GlobalConfig, LedgerConfig, P2pConfig, SnarkConfig, State, TransitionFrontierConfig, }; -use openmina_node_invariants::{InvariantResult, Invariants}; -use openmina_node_native::{http_server, NodeServiceBuilder}; use serde::{de::DeserializeOwned, Serialize}; use temp_dir::TempDir; @@ -52,13 +52,13 @@ use crate::{ }; #[allow(dead_code)] -fn openmina_path>(path: P) -> Option { - std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".cache/openmina").join(path)) +fn mina_path>(path: P) -> Option { + std::env::var_os("HOME").map(|home| PathBuf::from(home).join(".cache/mina").join(path)) } #[allow(dead_code)] fn read_index(name: &str) -> Option { - openmina_path(name) + mina_path(name) .and_then(|path| { if !path.exists() { return None; @@ -86,7 +86,7 @@ fn read_index(name: &str) -> Option { #[allow(dead_code)] fn write_index(name: &str, index: &T) -> Option<()> { - openmina_path(name) + mina_path(name) .and_then(|path| { let Some(parent) = path.parent() else { warn!(system_time(); "cannot get parent for {path:?}"); @@ -334,7 +334,7 @@ impl Cluster { let shutdown = shutdown_listener.clone(); let rpc_sender = real_service.rpc_sender(); thread::Builder::new() - .name("openmina_http_server".to_owned()) + .name("mina_http_server".to_owned()) .spawn(move || { let local_set = tokio::task::LocalSet::new(); let task = async { @@ -367,7 +367,7 @@ impl Cluster { store.service.dyn_effects(store.state.get(), &action); let peer_id = store.state().p2p.my_id(); - openmina_core::log::trace!(action.time(); "{peer_id}: {:?}", action.action().kind()); + mina_core::log::trace!(action.time(); "{peer_id}: {:?}", action.action().kind()); for (invariant, res) in Invariants::check_all(store, &action) { // TODO(binier): record instead of panicing. diff --git a/node/testing/src/cluster/p2p_task_spawner.rs b/node/testing/src/cluster/p2p_task_spawner.rs index 7f33e5407f..7e35408b82 100644 --- a/node/testing/src/cluster/p2p_task_spawner.rs +++ b/node/testing/src/cluster/p2p_task_spawner.rs @@ -1,5 +1,5 @@ +use mina_core::channels::Aborted; use node::{core::thread, p2p::service_impl::TaskSpawner}; -use openmina_core::channels::Aborted; #[derive(Clone)] pub struct P2pTaskSpawner { @@ -23,7 +23,7 @@ impl TaskSpawner for P2pTaskSpawner { .build() .unwrap(); thread::Builder::new() - .name(format!("openmina_p2p_{name}")) + .name(format!("mina_p2p_{name}")) .spawn(move || { let fut = async { tokio::select! { diff --git a/node/testing/src/hosts.rs b/node/testing/src/hosts.rs index fca4ed63c8..544e7edb84 100644 --- a/node/testing/src/hosts.rs +++ b/node/testing/src/hosts.rs @@ -17,8 +17,8 @@ pub fn replayer() -> P2pConnectionOutgoingInitOpts { } pub fn devnet() -> Vec { - let seeds = std::env::var("OPENMINA_SCENARIO_SEEDS") - .unwrap_or_else(|_| node::p2p::DEVNET_SEEDS.join(" ")); + let seeds = + std::env::var("MINA_SCENARIO_SEEDS").unwrap_or_else(|_| node::p2p::DEVNET_SEEDS.join(" ")); seeds .split_whitespace() .map(P2pConnectionOutgoingInitOpts::from_str) diff --git a/node/testing/src/lib.rs b/node/testing/src/lib.rs index f2fb794863..81a5ee7cf0 100644 --- a/node/testing/src/lib.rs +++ b/node/testing/src/lib.rs @@ -20,10 +20,10 @@ pub use server::server; use tokio::sync::{Mutex, MutexGuard}; pub fn setup() -> tokio::runtime::Runtime { - openmina_node_native::tracing::initialize(openmina_node_native::tracing::Level::INFO); + mina_node_native::tracing::initialize(mina_node_native::tracing::Level::INFO); rayon::ThreadPoolBuilder::new() .num_threads(num_cpus::get().max(2) - 1) - .thread_name(|i| format!("openmina_rayon_{i}")) + .thread_name(|i| format!("mina_rayon_{i}")) .build_global() .unwrap(); @@ -36,7 +36,7 @@ pub fn setup() -> tokio::runtime::Runtime { pub fn setup_without_rt() { lazy_static::lazy_static! { static ref INIT: () = { - let level = std::env::var("OPENMINA_TRACING_LEVEL").ok().and_then(|level| { + let level = std::env::var("MINA_TRACING_LEVEL").ok().and_then(|level| { match level.parse() { Ok(v) => Some(v), Err(e) => { @@ -44,8 +44,8 @@ pub fn setup_without_rt() { None } } - }).unwrap_or(openmina_node_native::tracing::Level::INFO); - openmina_node_native::tracing::initialize(level); + }).unwrap_or(mina_node_native::tracing::Level::INFO); + mina_node_native::tracing::initialize(level); if let Err(err) = tracing_log::LogTracer::init() { eprintln!("cannot initialize log tracing bridge: {err}"); @@ -53,7 +53,7 @@ pub fn setup_without_rt() { rayon::ThreadPoolBuilder::new() .num_threads(num_cpus::get().max(2) - 1) - .thread_name(|i| format!("openmina_rayon_{i}")) + .thread_name(|i| format!("mina_rayon_{i}")) .build_global() .unwrap(); }; diff --git a/node/testing/src/main.rs b/node/testing/src/main.rs index 224103c4b1..84046be5af 100644 --- a/node/testing/src/main.rs +++ b/node/testing/src/main.rs @@ -1,13 +1,13 @@ use clap::Parser; -use node::p2p::webrtc::Host; -use openmina_node_testing::{ +use mina_node_testing::{ cluster::{Cluster, ClusterConfig}, exit_with_error, scenario::Scenario, scenarios::Scenarios, server, setup, }; +use node::p2p::webrtc::Host; pub type CommandError = anyhow::Error; @@ -62,7 +62,7 @@ impl Command { let rt = setup(); let _rt_guard = rt.enter(); - let (shutdown_tx, shutdown_rx) = openmina_core::channels::oneshot::channel(); + let (shutdown_tx, shutdown_rx) = mina_core::channels::oneshot::channel(); let mut shutdown_tx = Some(shutdown_tx); ctrlc::set_handler(move || match shutdown_tx.take() { diff --git a/node/testing/src/node/ocaml/config.rs b/node/testing/src/node/ocaml/config.rs index 5bd1e145af..a242cd4a40 100644 --- a/node/testing/src/node/ocaml/config.rs +++ b/node/testing/src/node/ocaml/config.rs @@ -136,7 +136,7 @@ impl OcamlNodeExecutable { fn docker_container_name(tmp_dir: &temp_dir::TempDir) -> String { let path = tmp_dir.path().file_name().unwrap().to_str().unwrap(); - format!("openmina_testing_ocaml_{}", &path[1..]) + format!("mina_testing_ocaml_{}", &path[1..]) } /// Additional logic for killing the node. diff --git a/node/testing/src/node/ocaml/mod.rs b/node/testing/src/node/ocaml/mod.rs index 4380c1c976..cb547bc339 100644 --- a/node/testing/src/node/ocaml/mod.rs +++ b/node/testing/src/node/ocaml/mod.rs @@ -1,11 +1,11 @@ mod config; pub use config::*; +use mina_core::{thread, ChainId}; use mina_p2p_messages::v2::StateHash; use node::p2p::{ connection::outgoing::{P2pConnectionOutgoingInitLibp2pOpts, P2pConnectionOutgoingInitOpts}, PeerId, }; -use openmina_core::{thread, ChainId}; use std::{ path::{Path, PathBuf}, diff --git a/node/testing/src/scenarios/multi_node/connection_discovery.rs b/node/testing/src/scenarios/multi_node/connection_discovery.rs index ffd9c6d210..fe184b5c71 100644 --- a/node/testing/src/scenarios/multi_node/connection_discovery.rs +++ b/node/testing/src/scenarios/multi_node/connection_discovery.rs @@ -22,7 +22,7 @@ pub struct RustNodeAsSeed; impl RustNodeAsSeed { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let rust_node_id = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); let rust_node_dial_addr = runner.node(rust_node_id).unwrap().dial_addr(); let rust_peer_id = *rust_node_dial_addr.peer_id(); @@ -96,7 +96,7 @@ pub struct OCamlToRust; impl OCamlToRust { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let rust_node_id = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); let rust_node_dial_addr = runner.node(rust_node_id).unwrap().dial_addr(); let rust_peer_id = *rust_node_dial_addr.peer_id(); @@ -146,7 +146,7 @@ pub struct RustToOCaml; impl RustToOCaml { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let rust_node_id = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); let rust_peer_id = runner.node(rust_node_id).expect("Node not found").peer_id(); wait_for_node_ready(&mut runner, rust_node_id).await; @@ -193,7 +193,7 @@ pub struct OCamlToRustViaSeed; impl OCamlToRustViaSeed { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let rust_node_id = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); wait_for_node_ready(&mut runner, rust_node_id).await; @@ -239,7 +239,7 @@ pub struct RustToOCamlViaSeed; impl RustToOCamlViaSeed { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let rust_node_id = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); wait_for_node_ready(&mut runner, rust_node_id).await; diff --git a/node/testing/src/scenarios/p2p/kademlia.rs b/node/testing/src/scenarios/p2p/kademlia.rs index 70793fb1cc..988cb36797 100644 --- a/node/testing/src/scenarios/p2p/kademlia.rs +++ b/node/testing/src/scenarios/p2p/kademlia.rs @@ -24,7 +24,7 @@ pub struct KademliaBootstrap; impl KademliaBootstrap { pub async fn run(self, mut runner: ClusterRunner<'_>) { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); const NUM: u8 = 16; let seed_node = runner.add_rust_node(RustNodeTestingConfig::devnet_default()); @@ -35,7 +35,7 @@ impl KademliaBootstrap { initial_peers: vec![ListenerNode::Rust(seed_node)], ..RustNodeTestingConfig::devnet_default() }; - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "true"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "true"); for _ in 0..NUM { let node_id = runner.add_rust_node(config.clone()); let peer_id = runner.node(node_id).expect("Node not found").peer_id(); @@ -54,7 +54,7 @@ impl KademliaBootstrap { "Seed doesn't have all peers in it's routing table" ); - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "true"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "true"); let new_node = runner.add_rust_node(config); let new_node_peer_id = runner.node(new_node).expect("Not note found").peer_id(); diff --git a/node/testing/src/scenarios/record_replay/block_production.rs b/node/testing/src/scenarios/record_replay/block_production.rs index a4230de90f..425a34c2d8 100644 --- a/node/testing/src/scenarios/record_replay/block_production.rs +++ b/node/testing/src/scenarios/record_replay/block_production.rs @@ -1,8 +1,8 @@ use std::time::Duration; +use mina_node_native::replay_state_with_input_actions; use mina_p2p_messages::v2; use node::transition_frontier::genesis::{GenesisConfig, NonStakers}; -use openmina_node_native::replay_state_with_input_actions; use crate::{ node::Recorder, diff --git a/node/testing/src/scenarios/record_replay/bootstrap.rs b/node/testing/src/scenarios/record_replay/bootstrap.rs index f081b98a6d..15fa1e0240 100644 --- a/node/testing/src/scenarios/record_replay/bootstrap.rs +++ b/node/testing/src/scenarios/record_replay/bootstrap.rs @@ -1,7 +1,7 @@ use std::time::Duration; +use mina_node_native::replay_state_with_input_actions; use node::ActionKind; -use openmina_node_native::replay_state_with_input_actions; use crate::{ hosts, diff --git a/node/testing/src/scenarios/solo_node/bootstrap.rs b/node/testing/src/scenarios/solo_node/bootstrap.rs index 9ce1101e73..d30b523ffd 100644 --- a/node/testing/src/scenarios/solo_node/bootstrap.rs +++ b/node/testing/src/scenarios/solo_node/bootstrap.rs @@ -1,7 +1,7 @@ use std::time::Duration; +use mina_core::constants::constraint_constants; use node::transition_frontier::sync::TransitionFrontierSyncState; -use openmina_core::constants::constraint_constants; use redux::Instant; use crate::{ diff --git a/node/testing/src/server/mod.rs b/node/testing/src/server/mod.rs index 8088498f24..235db5aa18 100644 --- a/node/testing/src/server/mod.rs +++ b/node/testing/src/server/mod.rs @@ -22,6 +22,7 @@ use axum::{ routing::{get, get_service, post, put}, Json, Router, }; +use mina_node_native::p2p::webrtc::webrtc_signal_send; use node::{ account::AccountPublicKey, p2p::{ @@ -30,7 +31,6 @@ use node::{ }, transition_frontier::genesis::{GenesisConfig, PrebuiltGenesisConfig}, }; -use openmina_node_native::p2p::webrtc::webrtc_signal_send; use rand::{rngs::StdRng, Rng, SeedableRng}; use serde::{Deserialize, Serialize}; use tokio::{ diff --git a/node/testing/src/server/simulator.rs b/node/testing/src/server/simulator.rs index f4df9a0df1..3881ea7525 100644 --- a/node/testing/src/server/simulator.rs +++ b/node/testing/src/server/simulator.rs @@ -5,8 +5,8 @@ use axum::{ http::StatusCode, routing::put, }; +use mina_core::channels::oneshot; use mina_p2p_messages::v2; -use openmina_core::channels::oneshot; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/node/testing/src/service/mod.rs b/node/testing/src/service/mod.rs index 502745168f..06183e68ec 100644 --- a/node/testing/src/service/mod.rs +++ b/node/testing/src/service/mod.rs @@ -15,6 +15,8 @@ use ledger::{ }, Mask, }; +use mina_core::channels::Aborter; +use mina_node_native::NodeService; use mina_p2p_messages::{ string::ByteString, v2::{ @@ -61,8 +63,6 @@ use node::{ transition_frontier::{archive::archive_service::ArchiveService, genesis::GenesisConfig}, ActionWithMeta, State, }; -use openmina_core::channels::Aborter; -use openmina_node_native::NodeService; use redux::Instant; use crate::{ @@ -74,7 +74,7 @@ pub type DynEffects = Box &'static str { "PendingEventId" } @@ -548,7 +548,7 @@ impl BlockProducerService for NodeTestingService { let _ = self.real.event_sender().send(dummy_proof_event(block_hash)); } ProofKind::ConstraintsChecked => { - match openmina_node_native::block_producer::prove( + match mina_node_native::block_producer::prove( self.provers(), &mut input, &keypair, @@ -582,7 +582,7 @@ impl BlockProducerService for NodeTestingService { { Ok(proof.clone()) } else { - openmina_node_native::block_producer::prove( + mina_node_native::block_producer::prove( self.provers(), &mut input, &keypair, diff --git a/node/testing/src/service/rpc_service.rs b/node/testing/src/service/rpc_service.rs index 43f63ca5e8..0269d8c14c 100644 --- a/node/testing/src/service/rpc_service.rs +++ b/node/testing/src/service/rpc_service.rs @@ -1,8 +1,8 @@ +use mina_core::requests::RpcId; use node::{ p2p::connection::P2pConnectionResponse, rpc::RpcMessageProgressResponse, rpc_effectful::RespondError, service::RpcService, State, }; -use openmina_core::requests::RpcId; macro_rules! to_real { ($name:ident, $response:ty $(,)?) => { diff --git a/node/testing/tests/common.rs b/node/testing/tests/common.rs index d26df0288c..c5747a34b5 100644 --- a/node/testing/tests/common.rs +++ b/node/testing/tests/common.rs @@ -17,7 +17,7 @@ macro_rules! scenario_test { #[tokio::test] $(#[$meta])? async fn $name() { - use openmina_node_testing::{ + use mina_node_testing::{ cluster::Cluster, scenarios::{ClusterRunner, Scenarios}, setup_without_rt, wait_for_other_tests, diff --git a/node/testing/tests/connection_discovery_ocaml_to_rust.rs b/node/testing/tests/connection_discovery_ocaml_to_rust.rs index 0481f3eeb4..f61aeab917 100644 --- a/node/testing/tests/connection_discovery_ocaml_to_rust.rs +++ b/node/testing/tests/connection_discovery_ocaml_to_rust.rs @@ -1,6 +1,6 @@ #![cfg(all(not(feature = "p2p-webrtc"), feature = "p2p-libp2p"))] -use openmina_node_testing::scenarios::multi_node::connection_discovery::OCamlToRust; +use mina_node_testing::scenarios::multi_node::connection_discovery::OCamlToRust; mod common; diff --git a/node/testing/tests/connection_discovery_ocaml_to_rust_via_seed.rs b/node/testing/tests/connection_discovery_ocaml_to_rust_via_seed.rs index e7d197c110..231adeaf62 100644 --- a/node/testing/tests/connection_discovery_ocaml_to_rust_via_seed.rs +++ b/node/testing/tests/connection_discovery_ocaml_to_rust_via_seed.rs @@ -1,6 +1,6 @@ #![cfg(all(not(feature = "p2p-webrtc"), feature = "p2p-libp2p"))] -use openmina_node_testing::scenarios::multi_node::connection_discovery::OCamlToRustViaSeed; +use mina_node_testing::scenarios::multi_node::connection_discovery::OCamlToRustViaSeed; mod common; diff --git a/node/testing/tests/connection_discovery_rust_as_seed.rs b/node/testing/tests/connection_discovery_rust_as_seed.rs index cd217861e6..0234cd7a49 100644 --- a/node/testing/tests/connection_discovery_rust_as_seed.rs +++ b/node/testing/tests/connection_discovery_rust_as_seed.rs @@ -1,6 +1,6 @@ #![cfg(all(not(feature = "p2p-webrtc"), feature = "p2p-libp2p"))] -use openmina_node_testing::scenarios::multi_node::connection_discovery::RustNodeAsSeed; +use mina_node_testing::scenarios::multi_node::connection_discovery::RustNodeAsSeed; mod common; diff --git a/node/testing/tests/connection_discovery_rust_to_ocaml.rs b/node/testing/tests/connection_discovery_rust_to_ocaml.rs index 16f165a5f3..c36abedceb 100644 --- a/node/testing/tests/connection_discovery_rust_to_ocaml.rs +++ b/node/testing/tests/connection_discovery_rust_to_ocaml.rs @@ -1,6 +1,6 @@ #![cfg(all(not(feature = "p2p-webrtc"), feature = "p2p-libp2p"))] -use openmina_node_testing::scenarios::multi_node::connection_discovery::RustToOCaml; +use mina_node_testing::scenarios::multi_node::connection_discovery::RustToOCaml; mod common; diff --git a/node/testing/tests/connection_discovery_rust_to_ocaml_via_seed.rs b/node/testing/tests/connection_discovery_rust_to_ocaml_via_seed.rs index 6049b48c3c..1ebedfa7e8 100644 --- a/node/testing/tests/connection_discovery_rust_to_ocaml_via_seed.rs +++ b/node/testing/tests/connection_discovery_rust_to_ocaml_via_seed.rs @@ -1,6 +1,6 @@ #![cfg(all(not(feature = "p2p-webrtc"), feature = "p2p-libp2p"))] -use openmina_node_testing::scenarios::multi_node::connection_discovery::RustToOCamlViaSeed; +use mina_node_testing::scenarios::multi_node::connection_discovery::RustToOCamlViaSeed; mod common; diff --git a/node/testing/tests/multi_node_initial_joining.rs b/node/testing/tests/multi_node_initial_joining.rs index b5be610cfd..2441af686b 100644 --- a/node/testing/tests/multi_node_initial_joining.rs +++ b/node/testing/tests/multi_node_initial_joining.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::multi_node::basic_connectivity_initial_joining::MultiNodeBasicConnectivityInitialJoining; +use mina_node_testing::scenarios::multi_node::basic_connectivity_initial_joining::MultiNodeBasicConnectivityInitialJoining; mod common; diff --git a/node/testing/tests/multi_node_peer_discovery.rs b/node/testing/tests/multi_node_peer_discovery.rs index b48d702438..5d7e07feef 100644 --- a/node/testing/tests/multi_node_peer_discovery.rs +++ b/node/testing/tests/multi_node_peer_discovery.rs @@ -1,5 +1,5 @@ #[cfg(not(feature = "p2p-webrtc"))] -use openmina_node_testing::scenarios::multi_node::basic_connectivity_peer_discovery::MultiNodeBasicConnectivityPeerDiscovery; +use mina_node_testing::scenarios::multi_node::basic_connectivity_peer_discovery::MultiNodeBasicConnectivityPeerDiscovery; mod common; diff --git a/node/testing/tests/multi_node_propagate_block.rs b/node/testing/tests/multi_node_propagate_block.rs index 5b60543928..ac63d2c11a 100644 --- a/node/testing/tests/multi_node_propagate_block.rs +++ b/node/testing/tests/multi_node_propagate_block.rs @@ -3,6 +3,6 @@ mod common; #[cfg(feature = "p2p-libp2p")] scenario_test!( propagate_block, - openmina_node_testing::scenarios::multi_node::pubsub_advanced::MultiNodePubsubPropagateBlock, - openmina_node_testing::scenarios::multi_node::pubsub_advanced::MultiNodePubsubPropagateBlock + mina_node_testing::scenarios::multi_node::pubsub_advanced::MultiNodePubsubPropagateBlock, + mina_node_testing::scenarios::multi_node::pubsub_advanced::MultiNodePubsubPropagateBlock ); diff --git a/node/testing/tests/node_libp2p_only.rs b/node/testing/tests/node_libp2p_only.rs index a7106cfda2..54b3fb4c0d 100644 --- a/node/testing/tests/node_libp2p_only.rs +++ b/node/testing/tests/node_libp2p_only.rs @@ -1,6 +1,6 @@ #![cfg(feature = "scenario-generators")] -use openmina_node_testing::{cluster::ClusterConfig, scenarios::Scenarios, setup}; +use mina_node_testing::{cluster::ClusterConfig, scenarios::Scenarios, setup}; #[test] fn node_libp2p_only_all_scenarios() { diff --git a/node/testing/tests/node_libp2p_with_rust_to_rust_webrtc.rs b/node/testing/tests/node_libp2p_with_rust_to_rust_webrtc.rs index 492932f6f3..b04e4b560c 100644 --- a/node/testing/tests/node_libp2p_with_rust_to_rust_webrtc.rs +++ b/node/testing/tests/node_libp2p_with_rust_to_rust_webrtc.rs @@ -1,5 +1,5 @@ #[cfg(feature = "p2p-webrtc")] -use openmina_node_testing::{scenarios::Scenarios, setup}; +use mina_node_testing::{scenarios::Scenarios, setup}; #[cfg(feature = "p2p-webrtc")] #[test] diff --git a/node/testing/tests/p2p_basic_connections.rs b/node/testing/tests/p2p_basic_connections.rs index d2570ef6af..6a937edf43 100644 --- a/node/testing/tests/p2p_basic_connections.rs +++ b/node/testing/tests/p2p_basic_connections.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::p2p::basic_connection_handling::{ +use mina_node_testing::scenarios::p2p::basic_connection_handling::{ AllNodesConnectionsAreSymmetric, MaxNumberOfPeersIncoming, MaxNumberOfPeersIs1, SeedConnectionsAreSymmetric, SimultaneousConnections, }; diff --git a/node/testing/tests/p2p_basic_incoming.rs b/node/testing/tests/p2p_basic_incoming.rs index 35f73c57d4..516a84281f 100644 --- a/node/testing/tests/p2p_basic_incoming.rs +++ b/node/testing/tests/p2p_basic_incoming.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::p2p::basic_incoming_connections::{ +use mina_node_testing::scenarios::p2p::basic_incoming_connections::{ AcceptIncomingConnection, AcceptMultipleIncomingConnections, }; diff --git a/node/testing/tests/p2p_basic_outgoing.rs b/node/testing/tests/p2p_basic_outgoing.rs index d334bc0490..6af7db5795 100644 --- a/node/testing/tests/p2p_basic_outgoing.rs +++ b/node/testing/tests/p2p_basic_outgoing.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::p2p::basic_outgoing_connections::{ +use mina_node_testing::scenarios::p2p::basic_outgoing_connections::{ ConnectToInitialPeers, ConnectToInitialPeersBecomeReady, ConnectToUnavailableInitialPeers, DontConnectToInitialPeerWithSameId, DontConnectToNodeWithSameId, DontConnectToSelfInitialPeer, MakeMultipleOutgoingConnections, MakeOutgoingConnection, diff --git a/node/testing/tests/p2p_kad.rs b/node/testing/tests/p2p_kad.rs index 44f3b5cb76..e224262c07 100644 --- a/node/testing/tests/p2p_kad.rs +++ b/node/testing/tests/p2p_kad.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::p2p::kademlia::KademliaBootstrap; +use mina_node_testing::scenarios::p2p::kademlia::KademliaBootstrap; mod common; diff --git a/node/testing/tests/p2p_pubsub.rs b/node/testing/tests/p2p_pubsub.rs index 025853d646..e001a36fee 100644 --- a/node/testing/tests/p2p_pubsub.rs +++ b/node/testing/tests/p2p_pubsub.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::p2p::pubsub::P2pReceiveMessage; +use mina_node_testing::scenarios::p2p::pubsub::P2pReceiveMessage; mod common; diff --git a/node/testing/tests/p2p_signaling.rs b/node/testing/tests/p2p_signaling.rs index ce17eac88c..a855f4182c 100644 --- a/node/testing/tests/p2p_signaling.rs +++ b/node/testing/tests/p2p_signaling.rs @@ -1,6 +1,6 @@ #![cfg(feature = "p2p-webrtc")] -use openmina_node_testing::scenarios::p2p::signaling::P2pSignaling; +use mina_node_testing::scenarios::p2p::signaling::P2pSignaling; mod common; diff --git a/node/testing/tests/record_replay.rs b/node/testing/tests/record_replay.rs index 2f09bf5a94..6fe0821db1 100644 --- a/node/testing/tests/record_replay.rs +++ b/node/testing/tests/record_replay.rs @@ -1,4 +1,4 @@ -use openmina_node_testing::scenarios::record_replay::{ +use mina_node_testing::scenarios::record_replay::{ block_production::RecordReplayBlockProduction, bootstrap::RecordReplayBootstrap, }; diff --git a/node/testing/tests/single_node.rs b/node/testing/tests/single_node.rs index 20e49e35e5..64ccf7678b 100644 --- a/node/testing/tests/single_node.rs +++ b/node/testing/tests/single_node.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "p2p-webrtc"))] -use openmina_node_testing::scenarios::solo_node::basic_connectivity_accept_incoming::SoloNodeBasicConnectivityAcceptIncoming; -use openmina_node_testing::scenarios::solo_node::{ +use mina_node_testing::scenarios::solo_node::basic_connectivity_accept_incoming::SoloNodeBasicConnectivityAcceptIncoming; +use mina_node_testing::scenarios::solo_node::{ basic_connectivity_initial_joining::SoloNodeBasicConnectivityInitialJoining, bootstrap::SoloNodeBootstrap, sync_root_snarked_ledger::SoloNodeSyncRootSnarkedLedger, }; diff --git a/node/web/Cargo.toml b/node/web/Cargo.toml index df7bb7c570..f35b4dedda 100644 --- a/node/web/Cargo.toml +++ b/node/web/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-node-web" +name = "mina-node-web" version = "0.16.0" edition = "2021" license = "Apache-2.0" @@ -31,9 +31,9 @@ js-sys = "0.3" wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" +mina-node-common = { path = "../common" } node = { path = "../../node" } -openmina-node-common = { path = "../common" } [features] default = ["p2p-webrtc"] -p2p-webrtc = ["openmina-node-common/p2p-webrtc"] +p2p-webrtc = ["mina-node-common/p2p-webrtc"] diff --git a/node/web/src/lib.rs b/node/web/src/lib.rs index 870512b0da..747ed05e6c 100644 --- a/node/web/src/lib.rs +++ b/node/web/src/lib.rs @@ -1,7 +1,7 @@ #![cfg(target_family = "wasm")] use ::node::transition_frontier::genesis::GenesisConfig; -pub use openmina_node_common::*; +pub use mina_node_common::*; mod rayon; pub use rayon::init_rayon; @@ -17,7 +17,7 @@ use ::node::{ use anyhow::Context; use gloo_utils::format::JsValueSerdeExt; use ledger::proofs::provers::BlockProver; -use openmina_node_common::rpc::RpcSender; +use mina_node_common::rpc::RpcSender; use wasm_bindgen::prelude::*; use crate::node::P2pTaskRemoteSpawner; @@ -100,7 +100,7 @@ async fn setup_node( block_producer: Option, seed_nodes_url: Option, genesis_config_url: Option, -) -> openmina_node_common::Node { +) -> mina_node_common::Node { let block_verifier_index = BlockVerifier::make().await; let work_verifier_index = TransactionVerifier::make().await; diff --git a/node/web/src/node/builder.rs b/node/web/src/node/builder.rs index 0e5ed481f6..3336f9e8e9 100644 --- a/node/web/src/node/builder.rs +++ b/node/web/src/node/builder.rs @@ -1,6 +1,7 @@ use std::{sync::Arc, time::Duration}; use ledger::proofs::provers::BlockProver; +use mina_node_common::{p2p::TaskSpawner, NodeServiceCommonBuilder}; use mina_p2p_messages::v2::{self, NonZeroCurvePoint}; use node::{ account::AccountSecretKey, @@ -14,7 +15,6 @@ use node::{ BlockProducerConfig, GlobalConfig, LedgerConfig, P2pConfig, SnarkConfig, SnarkerConfig, SnarkerStrategy, TransitionFrontierConfig, }; -use openmina_node_common::{p2p::TaskSpawner, NodeServiceCommonBuilder}; use rand::Rng; use super::{Node, P2pTaskSpawner}; diff --git a/node/web/src/node/mod.rs b/node/web/src/node/mod.rs index 81d7062de4..248197cea0 100644 --- a/node/web/src/node/mod.rs +++ b/node/web/src/node/mod.rs @@ -1,7 +1,7 @@ mod builder; pub use builder::*; -pub type Node = openmina_node_common::Node; +pub type Node = mina_node_common::Node; use ::node::core::thread; use std::future::Future; diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml index 5830964189..ef8c001eac 100644 --- a/p2p/Cargo.toml +++ b/p2p/Cargo.toml @@ -57,14 +57,14 @@ crypto-bigint = { version = "0.5.5", features = [ "serde", "alloc", ] } -openmina-core = { path = "../core" } -openmina-macros = { path = "../macros" } +mina-core = { path = "../core" } +mina-macros = { path = "../macros" } quick-protobuf = "0.8.1" salsa-simple = { path = "../tools/salsa-simple" } prost = { version = "0.12.4" } -openmina-fuzzer = { path = "../fuzzer", optional = true } +mina-fuzzer = { path = "../fuzzer", optional = true } [build-dependencies] prost-build = { version = "0.14.1" } @@ -123,4 +123,4 @@ p2p-webrtc = ["p2p-webrtc-rs"] p2p-webrtc-rs = ["webrtc", "rcgen"] p2p-webrtc-cpp = ["datachannel"] p2p-libp2p = ["fuzzing", "dep:reqwest", "dep:faster-stun"] -fuzzing = ["openmina-fuzzer", "openmina-core/fuzzing"] +fuzzing = ["mina-fuzzer", "mina-core/fuzzing"] diff --git a/p2p/README.md b/p2p/README.md index 72bc64e1ba..bc49030c38 100644 --- a/p2p/README.md +++ b/p2p/README.md @@ -1,11 +1,11 @@ # P2P Networking -This directory contains OpenMina's peer-to-peer networking implementation. +This directory contains Mina's peer-to-peer networking implementation. ## Documentation -For comprehensive documentation about OpenMina's P2P networking architecture, -please visit our documentation website: +For comprehensive documentation about Mina's P2P networking architecture, please +visit our documentation website: 📖 **[P2P Networking Documentation](https://o1-labs.github.io/openmina/developers/p2p-networking)** diff --git a/p2p/src/channels/best_tip/mod.rs b/p2p/src/channels/best_tip/mod.rs index ce8832b345..c579949e62 100644 --- a/p2p/src/channels/best_tip/mod.rs +++ b/p2p/src/channels/best_tip/mod.rs @@ -7,7 +7,7 @@ pub use p2p_channels_best_tip_actions::*; mod p2p_channels_best_tip_reducer; use binprot_derive::{BinProtRead, BinProtWrite}; -use openmina_core::block::ArcBlock; +use mina_core::block::ArcBlock; use serde::{Deserialize, Serialize}; #[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)] diff --git a/p2p/src/channels/best_tip/p2p_channels_best_tip_actions.rs b/p2p/src/channels/best_tip/p2p_channels_best_tip_actions.rs index 3daff6326a..0bcede44d7 100644 --- a/p2p/src/channels/best_tip/p2p_channels_best_tip_actions.rs +++ b/p2p/src/channels/best_tip/p2p_channels_best_tip_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{block::ArcBlockWithHash, ActionEvent}; +use mina_core::{block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/p2p/src/channels/best_tip/p2p_channels_best_tip_reducer.rs b/p2p/src/channels/best_tip/p2p_channels_best_tip_reducer.rs index ea350fee6c..d6155af315 100644 --- a/p2p/src/channels/best_tip/p2p_channels_best_tip_reducer.rs +++ b/p2p/src/channels/best_tip/p2p_channels_best_tip_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/best_tip/p2p_channels_best_tip_state.rs b/p2p/src/channels/best_tip/p2p_channels_best_tip_state.rs index 21c3ed3186..eedee9def6 100644 --- a/p2p/src/channels/best_tip/p2p_channels_best_tip_state.rs +++ b/p2p/src/channels/best_tip/p2p_channels_best_tip_state.rs @@ -1,4 +1,4 @@ -use openmina_core::block::ArcBlockWithHash; +use mina_core::block::ArcBlockWithHash; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/p2p/src/channels/p2p_channels_actions.rs b/p2p/src/channels/p2p_channels_actions.rs index 2fa46205a1..694ddefa39 100644 --- a/p2p/src/channels/p2p_channels_actions.rs +++ b/p2p/src/channels/p2p_channels_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::log::ActionEvent; +use mina_core::log::ActionEvent; use redux::Callback; use serde::{Deserialize, Serialize}; @@ -22,7 +22,7 @@ use super::{ ChannelId, ChannelMsg, MsgId, }; -#[derive(Serialize, Deserialize, Debug, Clone, openmina_core::ActionEvent)] +#[derive(Serialize, Deserialize, Debug, Clone, mina_core::ActionEvent)] pub enum P2pChannelsAction { MessageReceived(P2pChannelsMessageReceivedAction), SignalingDiscovery(P2pChannelsSignalingDiscoveryAction), @@ -35,7 +35,7 @@ pub enum P2pChannelsAction { StreamingRpc(P2pChannelsStreamingRpcAction), } -#[derive(Serialize, Deserialize, Debug, Clone, openmina_core::ActionEvent)] +#[derive(Serialize, Deserialize, Debug, Clone, mina_core::ActionEvent)] pub enum P2pChannelsEffectfulAction { InitChannel { peer_id: PeerId, @@ -130,7 +130,7 @@ impl From for crate::P2pAction { impl ActionEvent for P2pChannelsMessageReceivedAction { fn action_event(&self, _context: &T) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { } } diff --git a/p2p/src/channels/p2p_channels_effectful_effects.rs b/p2p/src/channels/p2p_channels_effectful_effects.rs index 275157e419..900c402cea 100644 --- a/p2p/src/channels/p2p_channels_effectful_effects.rs +++ b/p2p/src/channels/p2p_channels_effectful_effects.rs @@ -1,4 +1,4 @@ -use openmina_core::bug_condition; +use mina_core::bug_condition; use redux::ActionMeta; use crate::webrtc::{Offer, P2pConnectionResponse}; @@ -63,7 +63,7 @@ impl P2pChannelsEffectfulAction { } => match store.service().encrypt(&pub_key, offer.as_ref()) { Err(_) => { // TODO: handle - openmina_core::error!( + mina_core::error!( meta.time(); summary = "Failed to encrypt webrtc offer", peer_id = peer_id.to_string() diff --git a/p2p/src/channels/p2p_channels_reducer.rs b/p2p/src/channels/p2p_channels_reducer.rs index 624f7e428d..d423cdfb10 100644 --- a/p2p/src/channels/p2p_channels_reducer.rs +++ b/p2p/src/channels/p2p_channels_reducer.rs @@ -28,7 +28,7 @@ use crate::{ disconnection::{P2pDisconnectionAction, P2pDisconnectionReason}, P2pState, }; -use openmina_core::{block::BlockWithHash, error, Substate}; +use mina_core::{block::BlockWithHash, error, Substate}; use redux::{ActionWithMeta, Dispatcher}; impl P2pChannelsState { diff --git a/p2p/src/channels/rpc/mod.rs b/p2p/src/channels/rpc/mod.rs index 0f47f02b9d..f6cbc3dcdc 100644 --- a/p2p/src/channels/rpc/mod.rs +++ b/p2p/src/channels/rpc/mod.rs @@ -9,6 +9,11 @@ mod p2p_channels_rpc_reducer; use std::{sync::Arc, time::Duration}; use binprot_derive::{BinProtRead, BinProtWrite}; +use mina_core::{ + block::ArcBlock, + snark::{Snark, SnarkJobId}, + transaction::{Transaction, TransactionHash}, +}; use mina_p2p_messages::{ list::List, rpc_kernel::QueryID, @@ -19,11 +24,6 @@ use mina_p2p_messages::{ TransactionSnarkScanStateStableV2, }, }; -use openmina_core::{ - block::ArcBlock, - snark::{Snark, SnarkJobId}, - transaction::{Transaction, TransactionHash}, -}; use serde::{Deserialize, Serialize}; use crate::{connection::outgoing::P2pConnectionOutgoingInitOpts, P2pTimeouts}; diff --git a/p2p/src/channels/rpc/p2p_channels_rpc_actions.rs b/p2p/src/channels/rpc/p2p_channels_rpc_actions.rs index a84f8e1b56..3127291fd8 100644 --- a/p2p/src/channels/rpc/p2p_channels_rpc_actions.rs +++ b/p2p/src/channels/rpc/p2p_channels_rpc_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::Timestamp; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/channels/rpc/p2p_channels_rpc_reducer.rs b/p2p/src/channels/rpc/p2p_channels_rpc_reducer.rs index 62d93a34c9..07c27b2471 100644 --- a/p2p/src/channels/rpc/p2p_channels_rpc_reducer.rs +++ b/p2p/src/channels/rpc/p2p_channels_rpc_reducer.rs @@ -6,7 +6,7 @@ use crate::{ channels::{ChannelId, ChannelMsg, MsgId, P2pChannelsEffectfulAction}, P2pNetworkRpcAction, P2pPeerAction, P2pState, }; -use openmina_core::{block::BlockWithHash, bug_condition, error, Substate}; +use mina_core::{block::BlockWithHash, bug_condition, error, Substate}; use redux::ActionWithMeta; use std::collections::VecDeque; diff --git a/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_actions.rs b/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_actions.rs index 42f762028a..4f54f997cb 100644 --- a/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_actions.rs +++ b/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_reducer.rs b/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_reducer.rs index 2f5c91142f..8dfdd0a8d0 100644 --- a/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_reducer.rs +++ b/p2p/src/channels/signaling/discovery/p2p_channels_signaling_discovery_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_actions.rs b/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_actions.rs index c5842b89bd..01b5de6c8f 100644 --- a/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_actions.rs +++ b/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{ diff --git a/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_reducer.rs b/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_reducer.rs index 37620086c4..2d7983e73f 100644 --- a/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_reducer.rs +++ b/p2p/src/channels/signaling/exchange/p2p_channels_signaling_exchange_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/snark/mod.rs b/p2p/src/channels/snark/mod.rs index 23a97e887f..02c5fb76ab 100644 --- a/p2p/src/channels/snark/mod.rs +++ b/p2p/src/channels/snark/mod.rs @@ -7,7 +7,7 @@ pub use p2p_channels_snark_actions::*; mod p2p_channels_snark_reducer; use binprot_derive::{BinProtRead, BinProtWrite}; -use openmina_core::snark::SnarkInfo; +use mina_core::snark::SnarkInfo; use serde::{Deserialize, Serialize}; #[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)] diff --git a/p2p/src/channels/snark/p2p_channels_snark_actions.rs b/p2p/src/channels/snark/p2p_channels_snark_actions.rs index 0ce4b4682d..ca1be21cc3 100644 --- a/p2p/src/channels/snark/p2p_channels_snark_actions.rs +++ b/p2p/src/channels/snark/p2p_channels_snark_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{snark::Snark, ActionEvent}; +use mina_core::{snark::Snark, ActionEvent}; use serde::{Deserialize, Serialize}; use crate::{channels::P2pChannelsAction, P2pState, PeerId}; diff --git a/p2p/src/channels/snark/p2p_channels_snark_reducer.rs b/p2p/src/channels/snark/p2p_channels_snark_reducer.rs index fb31df3f99..1d00ddab30 100644 --- a/p2p/src/channels/snark/p2p_channels_snark_reducer.rs +++ b/p2p/src/channels/snark/p2p_channels_snark_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/snark_job_commitment/mod.rs b/p2p/src/channels/snark_job_commitment/mod.rs index 0625ee5aa5..06f5a896ea 100644 --- a/p2p/src/channels/snark_job_commitment/mod.rs +++ b/p2p/src/channels/snark_job_commitment/mod.rs @@ -7,7 +7,7 @@ pub use p2p_channels_snark_job_commitment_actions::*; mod p2p_channels_snark_job_commitment_reducer; use binprot_derive::{BinProtRead, BinProtWrite}; -use openmina_core::snark::SnarkJobCommitment; +use mina_core::snark::SnarkJobCommitment; use serde::{Deserialize, Serialize}; #[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)] diff --git a/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_actions.rs b/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_actions.rs index b1073ec0b6..61dbcee515 100644 --- a/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_actions.rs +++ b/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{P2pState, PeerId}; diff --git a/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_reducer.rs b/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_reducer.rs index 236a67ae93..c6f89e869e 100644 --- a/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_reducer.rs +++ b/p2p/src/channels/snark_job_commitment/p2p_channels_snark_job_commitment_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_actions.rs b/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_actions.rs index fdaa869daa..ae010a6157 100644 --- a/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_actions.rs +++ b/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::Timestamp; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_reducer.rs b/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_reducer.rs index 463b5436f6..60e56c966f 100644 --- a/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_reducer.rs +++ b/p2p/src/channels/streaming_rpc/p2p_channels_streaming_rpc_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/channels/transaction/mod.rs b/p2p/src/channels/transaction/mod.rs index 2701d2cf5e..468073e711 100644 --- a/p2p/src/channels/transaction/mod.rs +++ b/p2p/src/channels/transaction/mod.rs @@ -7,7 +7,7 @@ pub use p2p_channels_transaction_actions::*; mod p2p_channels_transaction_reducer; use binprot_derive::{BinProtRead, BinProtWrite}; -pub use openmina_core::transaction::{Transaction, TransactionHash, TransactionInfo}; +pub use mina_core::transaction::{Transaction, TransactionHash, TransactionInfo}; use serde::{Deserialize, Serialize}; #[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, Clone)] diff --git a/p2p/src/channels/transaction/p2p_channels_transaction_actions.rs b/p2p/src/channels/transaction/p2p_channels_transaction_actions.rs index 55536bb0f3..0065fca534 100644 --- a/p2p/src/channels/transaction/p2p_channels_transaction_actions.rs +++ b/p2p/src/channels/transaction/p2p_channels_transaction_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{p2p::P2pNetworkPubsubMessageCacheId, transaction::Transaction, ActionEvent}; +use mina_core::{p2p::P2pNetworkPubsubMessageCacheId, transaction::Transaction, ActionEvent}; use serde::{Deserialize, Serialize}; use crate::{channels::P2pChannelsAction, P2pState, PeerId}; diff --git a/p2p/src/channels/transaction/p2p_channels_transaction_reducer.rs b/p2p/src/channels/transaction/p2p_channels_transaction_reducer.rs index beee731bcc..c80abc2ad2 100644 --- a/p2p/src/channels/transaction/p2p_channels_transaction_reducer.rs +++ b/p2p/src/channels/transaction/p2p_channels_transaction_reducer.rs @@ -6,8 +6,8 @@ use crate::{ channels::{ChannelId, MsgId, P2pChannelsEffectfulAction}, P2pNetworkPubsubAction, P2pState, }; +use mina_core::{bug_condition, transaction::TransactionWithHash, Substate}; use mina_p2p_messages::{gossip::GossipNetMessageV2, v2}; -use openmina_core::{bug_condition, transaction::TransactionWithHash, Substate}; use redux::ActionWithMeta; impl P2pChannelsTransactionState { diff --git a/p2p/src/connection/incoming/p2p_connection_incoming_actions.rs b/p2p/src/connection/incoming/p2p_connection_incoming_actions.rs index 86c948cc82..72f36a4fab 100644 --- a/p2p/src/connection/incoming/p2p_connection_incoming_actions.rs +++ b/p2p/src/connection/incoming/p2p_connection_incoming_actions.rs @@ -5,7 +5,7 @@ use crate::{ connection::{P2pConnectionAction, P2pConnectionState}, webrtc, P2pAction, P2pPeerStatus, P2pState, PeerId, }; -use openmina_core::{requests::RpcId, ActionEvent}; +use mina_core::{requests::RpcId, ActionEvent}; use serde::{Deserialize, Serialize}; use std::net::SocketAddr; diff --git a/p2p/src/connection/incoming/p2p_connection_incoming_reducer.rs b/p2p/src/connection/incoming/p2p_connection_incoming_reducer.rs index aa30217363..0c6d12b61b 100644 --- a/p2p/src/connection/incoming/p2p_connection_incoming_reducer.rs +++ b/p2p/src/connection/incoming/p2p_connection_incoming_reducer.rs @@ -1,7 +1,7 @@ #[cfg(feature = "p2p-libp2p")] use std::net::{IpAddr, SocketAddr}; -use openmina_core::{bug_condition, debug, warn, Substate}; +use mina_core::{bug_condition, debug, warn, Substate}; use redux::{ActionWithMeta, Dispatcher, Timestamp}; use crate::{ diff --git a/p2p/src/connection/incoming/p2p_connection_incoming_state.rs b/p2p/src/connection/incoming/p2p_connection_incoming_state.rs index 638692411f..d16b757d03 100644 --- a/p2p/src/connection/incoming/p2p_connection_incoming_state.rs +++ b/p2p/src/connection/incoming/p2p_connection_incoming_state.rs @@ -4,7 +4,7 @@ use malloc_size_of_derive::MallocSizeOf; use redux::Timestamp; use serde::{Deserialize, Serialize}; -use openmina_core::requests::RpcId; +use mina_core::requests::RpcId; use crate::{webrtc, P2pTimeouts}; diff --git a/p2p/src/connection/incoming_effectful/p2p_connection_incoming_effectful_actions.rs b/p2p/src/connection/incoming_effectful/p2p_connection_incoming_effectful_actions.rs index c675ac79e8..110180c522 100644 --- a/p2p/src/connection/incoming_effectful/p2p_connection_incoming_effectful_actions.rs +++ b/p2p/src/connection/incoming_effectful/p2p_connection_incoming_effectful_actions.rs @@ -4,7 +4,7 @@ use crate::{ webrtc::{ConnectionAuth, ConnectionAuthEncrypted}, P2pState, PeerId, }; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/connection/outgoing/p2p_connection_outgoing_actions.rs b/p2p/src/connection/outgoing/p2p_connection_outgoing_actions.rs index 888c60724d..a8447771e0 100644 --- a/p2p/src/connection/outgoing/p2p_connection_outgoing_actions.rs +++ b/p2p/src/connection/outgoing/p2p_connection_outgoing_actions.rs @@ -1,8 +1,8 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::Callback; use serde::{Deserialize, Serialize}; -use openmina_core::requests::RpcId; +use mina_core::requests::RpcId; use crate::{connection::P2pConnectionErrorResponse, webrtc, P2pState, PeerId}; diff --git a/p2p/src/connection/outgoing/p2p_connection_outgoing_reducer.rs b/p2p/src/connection/outgoing/p2p_connection_outgoing_reducer.rs index 05ffc40c0a..e56592e180 100644 --- a/p2p/src/connection/outgoing/p2p_connection_outgoing_reducer.rs +++ b/p2p/src/connection/outgoing/p2p_connection_outgoing_reducer.rs @@ -1,6 +1,6 @@ use std::net::SocketAddr; -use openmina_core::{bug_condition, warn, Substate}; +use mina_core::{bug_condition, warn, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/connection/outgoing/p2p_connection_outgoing_state.rs b/p2p/src/connection/outgoing/p2p_connection_outgoing_state.rs index 2161ba6bc7..ef24d66e0b 100644 --- a/p2p/src/connection/outgoing/p2p_connection_outgoing_state.rs +++ b/p2p/src/connection/outgoing/p2p_connection_outgoing_state.rs @@ -2,7 +2,7 @@ use malloc_size_of_derive::MallocSizeOf; use redux::{Callback, Timestamp}; use serde::{Deserialize, Serialize}; -use openmina_core::requests::RpcId; +use mina_core::requests::RpcId; use crate::{connection::RejectionReason, webrtc, P2pTimeouts, PeerId}; diff --git a/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_actions.rs b/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_actions.rs index 3049d9c0b3..741648702e 100644 --- a/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_actions.rs +++ b/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_actions.rs @@ -1,7 +1,7 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; -use openmina_core::requests::RpcId; +use mina_core::requests::RpcId; use crate::{ connection::{outgoing::P2pConnectionOutgoingInitOpts, P2pConnectionEffectfulAction}, diff --git a/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_effects.rs b/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_effects.rs index c01c82b64c..19f5585aab 100644 --- a/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_effects.rs +++ b/p2p/src/connection/outgoing_effectful/p2p_connection_outgoing_effectful_effects.rs @@ -1,4 +1,4 @@ -use openmina_core::bug_condition; +use mina_core::bug_condition; use redux::ActionMeta; use crate::{ diff --git a/p2p/src/connection/p2p_connection_actions.rs b/p2p/src/connection/p2p_connection_actions.rs index ca3a3f193e..cf34347345 100644 --- a/p2p/src/connection/p2p_connection_actions.rs +++ b/p2p/src/connection/p2p_connection_actions.rs @@ -4,7 +4,7 @@ use super::{ outgoing::P2pConnectionOutgoingAction, outgoing_effectful::P2pConnectionOutgoingEffectfulAction, }; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/connection/p2p_connection_reducer.rs b/p2p/src/connection/p2p_connection_reducer.rs index b4efdfafc3..c79a947e01 100644 --- a/p2p/src/connection/p2p_connection_reducer.rs +++ b/p2p/src/connection/p2p_connection_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::Substate; +use mina_core::Substate; use redux::ActionWithMeta; use super::{ diff --git a/p2p/src/connection/p2p_connection_state.rs b/p2p/src/connection/p2p_connection_state.rs index b83b5707ea..acfc00c5b6 100644 --- a/p2p/src/connection/p2p_connection_state.rs +++ b/p2p/src/connection/p2p_connection_state.rs @@ -1,4 +1,4 @@ -use openmina_core::requests::RpcId; +use mina_core::requests::RpcId; use redux::Timestamp; use malloc_size_of_derive::MallocSizeOf; diff --git a/p2p/src/disconnection/p2p_disconnection_actions.rs b/p2p/src/disconnection/p2p_disconnection_actions.rs index e8fb710170..91d2ff7403 100644 --- a/p2p/src/disconnection/p2p_disconnection_actions.rs +++ b/p2p/src/disconnection/p2p_disconnection_actions.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use super::P2pDisconnectionReason; diff --git a/p2p/src/disconnection/p2p_disconnection_reducer.rs b/p2p/src/disconnection/p2p_disconnection_reducer.rs index 7af51b2a35..493d3a997e 100644 --- a/p2p/src/disconnection/p2p_disconnection_reducer.rs +++ b/p2p/src/disconnection/p2p_disconnection_reducer.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use openmina_core::{bug_condition, pseudo_rng, Substate}; +use mina_core::{bug_condition, pseudo_rng, Substate}; use rand::prelude::*; use redux::ActionWithMeta; diff --git a/p2p/src/disconnection_effectful/p2p_disconnection_effectful_actions.rs b/p2p/src/disconnection_effectful/p2p_disconnection_effectful_actions.rs index 33573a22b4..cc5d8d7ff8 100644 --- a/p2p/src/disconnection_effectful/p2p_disconnection_effectful_actions.rs +++ b/p2p/src/disconnection_effectful/p2p_disconnection_effectful_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{P2pPeerStatus, P2pState, PeerId}; diff --git a/p2p/src/fuzzer.rs b/p2p/src/fuzzer.rs index a12dbb5636..a867c0cc68 100644 --- a/p2p/src/fuzzer.rs +++ b/p2p/src/fuzzer.rs @@ -1,4 +1,4 @@ -use openmina_fuzzer::{FuzzerState, MutationStrategy}; +use mina_fuzzer::{FuzzerState, MutationStrategy}; use rand::Rng; use crate::{Data, YamuxFlags}; diff --git a/p2p/src/identify/p2p_identify_actions.rs b/p2p/src/identify/p2p_identify_actions.rs index 06cc19822c..f3c93ff2d4 100644 --- a/p2p/src/identify/p2p_identify_actions.rs +++ b/p2p/src/identify/p2p_identify_actions.rs @@ -1,5 +1,5 @@ use crate::{network::identify::P2pNetworkIdentify, ConnectionAddr, P2pState, PeerId}; -use openmina_macros::ActionEvent; +use mina_macros::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/identify/p2p_identify_reducer.rs b/p2p/src/identify/p2p_identify_reducer.rs index d492b240ef..0ad2852d95 100644 --- a/p2p/src/identify/p2p_identify_reducer.rs +++ b/p2p/src/identify/p2p_identify_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/identity/secret_key.rs b/p2p/src/identity/secret_key.rs index 5cd53a0d79..a621235853 100644 --- a/p2p/src/identity/secret_key.rs +++ b/p2p/src/identity/secret_key.rs @@ -4,7 +4,7 @@ use base64::Engine; use ed25519_dalek::{ ed25519::signature::SignerMut, pkcs8::EncodePrivateKey as _, SigningKey as Ed25519SecretKey, }; -use openmina_core::{EncryptedSecretKey, EncryptedSecretKeyFile, EncryptionError}; +use mina_core::{EncryptedSecretKey, EncryptedSecretKeyFile, EncryptionError}; use rand::{CryptoRng, Rng}; use serde::{Deserialize, Serialize}; use zeroize::Zeroizing; diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs index 17506046a3..2eca39c863 100644 --- a/p2p/src/lib.rs +++ b/p2p/src/lib.rs @@ -31,11 +31,11 @@ use disconnection::P2pDisconnectionAction; use disconnection_effectful::P2pDisconnectionEffectfulAction; use identify::P2pIdentifyAction; pub use identity::PeerId; +use mina_core::SubstateAccess; use network::identify::{ stream_effectful::P2pNetworkIdentifyStreamEffectfulAction, P2pNetworkIdentifyState, P2pNetworkIdentifyStreamAction, }; -use openmina_core::SubstateAccess; pub mod webrtc; diff --git a/p2p/src/network/identify/p2p_network_identify_actions.rs b/p2p/src/network/identify/p2p_network_identify_actions.rs index 1a8dbd32a3..dc1fa1762c 100644 --- a/p2p/src/network/identify/p2p_network_identify_actions.rs +++ b/p2p/src/network/identify/p2p_network_identify_actions.rs @@ -5,7 +5,7 @@ use crate::{ }, P2pAction, P2pEffectfulAction, P2pNetworkAction, P2pNetworkEffectfulAction, P2pState, }; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/identify/p2p_network_identify_reducer.rs b/p2p/src/network/identify/p2p_network_identify_reducer.rs index b7ba6684d2..21fb59fca0 100644 --- a/p2p/src/network/identify/p2p_network_identify_reducer.rs +++ b/p2p/src/network/identify/p2p_network_identify_reducer.rs @@ -1,6 +1,6 @@ use super::{stream::P2pNetworkIdentifyStreamState, P2pNetworkIdentifyAction}; use crate::P2pLimits; -use openmina_core::Substate; +use mina_core::Substate; use redux::ActionWithMeta; impl super::P2pNetworkIdentifyState { diff --git a/p2p/src/network/identify/stream/p2p_network_identify_stream_actions.rs b/p2p/src/network/identify/stream/p2p_network_identify_stream_actions.rs index 2d22901b9a..ea8acb6f9d 100644 --- a/p2p/src/network/identify/stream/p2p_network_identify_stream_actions.rs +++ b/p2p/src/network/identify/stream/p2p_network_identify_stream_actions.rs @@ -1,6 +1,6 @@ use crate::{ConnectionAddr, Data, P2pAction, P2pState, PeerId, StreamId}; +use mina_core::ActionEvent; use multiaddr::Multiaddr; -use openmina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/identify/stream/p2p_network_identify_stream_reducer.rs b/p2p/src/network/identify/stream/p2p_network_identify_stream_reducer.rs index 6206a6e553..5f121c92d3 100644 --- a/p2p/src/network/identify/stream/p2p_network_identify_stream_reducer.rs +++ b/p2p/src/network/identify/stream/p2p_network_identify_stream_reducer.rs @@ -12,8 +12,8 @@ use crate::{ token, ConnectionAddr, Data, P2pLimits, P2pNetworkConnectionError, P2pNetworkSchedulerAction, P2pNetworkStreamProtobufError, P2pNetworkYamuxAction, P2pState, PeerId, YamuxFlags, }; +use mina_core::{bug_condition, fuzzed_maybe, warn, Substate, SubstateAccess}; use multiaddr::Multiaddr; -use openmina_core::{bug_condition, fuzzed_maybe, warn, Substate, SubstateAccess}; use prost::Message; use quick_protobuf::BytesReader; use redux::{ActionWithMeta, Dispatcher}; @@ -398,7 +398,7 @@ impl P2pNetworkIdentifyStreamState { let identify_msg = P2pNetworkIdentify { protocol_version: Some("ipfs/0.1.0".to_string()), // TODO: include build info from GlobalConfig (?) - agent_version: Some("openmina".to_owned()), + agent_version: Some("mina".to_owned()), public_key, listen_addrs, // TODO: other peers seem to report inaccurate information, should we implement this? diff --git a/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_actions.rs b/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_actions.rs index 3e669c314c..d5df863d30 100644 --- a/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_actions.rs +++ b/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_actions.rs @@ -1,7 +1,7 @@ use std::net::SocketAddr; use crate::{ConnectionAddr, P2pState, PeerId, StreamId}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_effects.rs b/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_effects.rs index 25ce52c2ab..430288350d 100644 --- a/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_effects.rs +++ b/p2p/src/network/identify/stream_effectful/p2p_network_identify_stream_effectful_effects.rs @@ -1,5 +1,5 @@ +use mina_core::{error, log::system_time}; use multiaddr::Multiaddr; -use openmina_core::{error, log::system_time}; use redux::ActionMeta; use std::net::SocketAddr; diff --git a/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_actions.rs b/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_actions.rs index fd417e3f45..988ead36fb 100644 --- a/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_actions.rs +++ b/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_reducer.rs b/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_reducer.rs index 3b0e592297..87996414f5 100644 --- a/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_reducer.rs +++ b/p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_reducer.rs @@ -1,6 +1,6 @@ use std::mem; -use openmina_core::{bug_condition, Substate, SubstateAccess}; +use mina_core::{bug_condition, Substate, SubstateAccess}; use redux::ActionWithMeta; use crate::{ diff --git a/p2p/src/network/kad/kad_effectful/p2p_network_kad_effectful_actions.rs b/p2p/src/network/kad/kad_effectful/p2p_network_kad_effectful_actions.rs index 5ef7a1a93b..b62f30c8d6 100644 --- a/p2p/src/network/kad/kad_effectful/p2p_network_kad_effectful_actions.rs +++ b/p2p/src/network/kad/kad_effectful/p2p_network_kad_effectful_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use multiaddr::Multiaddr; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/kad/p2p_network_kad_actions.rs b/p2p/src/network/kad/p2p_network_kad_actions.rs index 5ac763855b..163e089c58 100644 --- a/p2p/src/network/kad/p2p_network_kad_actions.rs +++ b/p2p/src/network/kad/p2p_network_kad_actions.rs @@ -1,5 +1,5 @@ +use mina_core::ActionEvent; use multiaddr::Multiaddr; -use openmina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/kad/p2p_network_kad_internals.rs b/p2p/src/network/kad/p2p_network_kad_internals.rs index fd98066317..7db6844db2 100644 --- a/p2p/src/network/kad/p2p_network_kad_internals.rs +++ b/p2p/src/network/kad/p2p_network_kad_internals.rs @@ -7,8 +7,8 @@ use crypto_bigint::{ArrayEncoding, Encoding, U256}; use derive_more::From; use libp2p_identity::DecodingError; use malloc_size_of_derive::MallocSizeOf; +use mina_core::bug_condition; use multiaddr::Multiaddr; -use openmina_core::bug_condition; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -394,8 +394,8 @@ impl P2pNetworkKadEntry { pub fn new(peer_id: PeerId, addrs: Vec) -> Result { if addrs.len() > Self::MAX_ADDRS { - openmina_core::log::info!( - openmina_core::log::system_time(); + mina_core::log::info!( + mina_core::log::system_time(); kind = "P2pNetworkKadEntry new", summary = format!("truncating {addrs:?} to {} elements", Self::MAX_ADDRS), ); @@ -581,8 +581,8 @@ impl P2pNetworkKadBucket { for addr in addrs { if e.addrs.len() >= P2pNetworkKadEntry::MAX_ADDRS { - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); kind = "P2pNetworkKadBucket insert", peer_id = e.peer_id.to_string(), summary = format!("Skipping updates to Kad entry multiaddress list"), diff --git a/p2p/src/network/kad/p2p_network_kad_reducer.rs b/p2p/src/network/kad/p2p_network_kad_reducer.rs index de1503ef2d..fb0e78e386 100644 --- a/p2p/src/network/kad/p2p_network_kad_reducer.rs +++ b/p2p/src/network/kad/p2p_network_kad_reducer.rs @@ -1,5 +1,5 @@ use crate::{P2pLimits, P2pNetworkKadEntry}; -use openmina_core::{debug, Substate, SubstateAccess}; +use mina_core::{debug, Substate, SubstateAccess}; use redux::ActionWithMeta; use super::{ diff --git a/p2p/src/network/kad/p2p_network_kad_state.rs b/p2p/src/network/kad/p2p_network_kad_state.rs index 927e5ce77a..88f70b1168 100644 --- a/p2p/src/network/kad/p2p_network_kad_state.rs +++ b/p2p/src/network/kad/p2p_network_kad_state.rs @@ -70,7 +70,7 @@ impl Default for P2pNetworkKadState { requests: Default::default(), streams: Default::default(), status: Default::default(), - filter_addrs: std::env::var("OPENMINA_DISCOVERY_FILTER_ADDR") + filter_addrs: std::env::var("MINA_DISCOVERY_FILTER_ADDR") .ok() .and_then(|s| s.parse().ok()) .unwrap_or(true), diff --git a/p2p/src/network/kad/request/p2p_network_kad_request_actions.rs b/p2p/src/network/kad/request/p2p_network_kad_request_actions.rs index 2275615fcf..4ddccbf0d0 100644 --- a/p2p/src/network/kad/request/p2p_network_kad_request_actions.rs +++ b/p2p/src/network/kad/request/p2p_network_kad_request_actions.rs @@ -1,6 +1,6 @@ use std::net::SocketAddr; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::{Callback, EnablingCondition}; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/kad/request/p2p_network_kad_request_reducer.rs b/p2p/src/network/kad/request/p2p_network_kad_request_reducer.rs index 8917120ede..891e4d989b 100644 --- a/p2p/src/network/kad/request/p2p_network_kad_request_reducer.rs +++ b/p2p/src/network/kad/request/p2p_network_kad_request_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, requests::RpcId, Substate, SubstateAccess}; +use mina_core::{bug_condition, requests::RpcId, Substate, SubstateAccess}; use redux::{ActionWithMeta, Dispatcher}; use crate::{ diff --git a/p2p/src/network/kad/stream/p2p_network_kad_stream_actions.rs b/p2p/src/network/kad/stream/p2p_network_kad_stream_actions.rs index 28d838bea4..48c3479c3b 100644 --- a/p2p/src/network/kad/stream/p2p_network_kad_stream_actions.rs +++ b/p2p/src/network/kad/stream/p2p_network_kad_stream_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; diff --git a/p2p/src/network/kad/stream/p2p_network_kad_stream_reducer.rs b/p2p/src/network/kad/stream/p2p_network_kad_stream_reducer.rs index ed8f2d3bdb..a4f51eb555 100644 --- a/p2p/src/network/kad/stream/p2p_network_kad_stream_reducer.rs +++ b/p2p/src/network/kad/stream/p2p_network_kad_stream_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, fuzzed_maybe, warn, Substate, SubstateAccess}; +use mina_core::{bug_condition, fuzzed_maybe, warn, Substate, SubstateAccess}; use quick_protobuf::{serialize_into_vec, BytesReader}; use redux::ActionWithMeta; diff --git a/p2p/src/network/noise/p2p_network_noise_actions.rs b/p2p/src/network/noise/p2p_network_noise_actions.rs index 4d9aeaad40..52e43ffbe8 100644 --- a/p2p/src/network/noise/p2p_network_noise_actions.rs +++ b/p2p/src/network/noise/p2p_network_noise_actions.rs @@ -1,6 +1,6 @@ use super::p2p_network_noise_state::Sk; use crate::{ConnectionAddr, Data, P2pNetworkAction, P2pState, PeerId}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/network/noise/p2p_network_noise_reducer.rs b/p2p/src/network/noise/p2p_network_noise_reducer.rs index 356d88405c..e07c63ade4 100644 --- a/p2p/src/network/noise/p2p_network_noise_reducer.rs +++ b/p2p/src/network/noise/p2p_network_noise_reducer.rs @@ -1,6 +1,6 @@ use chacha20poly1305::{aead::generic_array::GenericArray, AeadInPlace, ChaCha20Poly1305, KeyInit}; use crypto_bigint::consts::U12; -use openmina_core::{bug_condition, fuzzed_maybe, Substate}; +use mina_core::{bug_condition, fuzzed_maybe, Substate}; use crate::{ connection::incoming::{P2pConnectionIncomingAction, P2pConnectionIncomingState}, diff --git a/p2p/src/network/p2p_network_actions.rs b/p2p/src/network/p2p_network_actions.rs index 06bc476aa7..a2eedf9bae 100644 --- a/p2p/src/network/p2p_network_actions.rs +++ b/p2p/src/network/p2p_network_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use super::{ diff --git a/p2p/src/network/p2p_network_reducer.rs b/p2p/src/network/p2p_network_reducer.rs index fd4073f6bc..9f87c598b4 100644 --- a/p2p/src/network/p2p_network_reducer.rs +++ b/p2p/src/network/p2p_network_reducer.rs @@ -1,6 +1,6 @@ use crate::P2pLimits; use identify::P2pNetworkIdentifyState; -use openmina_core::Substate; +use mina_core::Substate; use super::*; diff --git a/p2p/src/network/p2p_network_state.rs b/p2p/src/network/p2p_network_state.rs index 5488b69b6a..c90a092707 100644 --- a/p2p/src/network/p2p_network_state.rs +++ b/p2p/src/network/p2p_network_state.rs @@ -1,5 +1,5 @@ +use mina_core::ChainId; use multiaddr::Multiaddr; -use openmina_core::ChainId; use serde::{Deserialize, Serialize}; use crate::{identity::PublicKey, PeerId}; diff --git a/p2p/src/network/pnet/p2p_network_pnet_actions.rs b/p2p/src/network/pnet/p2p_network_pnet_actions.rs index d4b26ab4d3..fdcf012a6e 100644 --- a/p2p/src/network/pnet/p2p_network_pnet_actions.rs +++ b/p2p/src/network/pnet/p2p_network_pnet_actions.rs @@ -1,5 +1,5 @@ use crate::{ConnectionAddr, Data, P2pState}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/network/pnet/p2p_network_pnet_reducer.rs b/p2p/src/network/pnet/p2p_network_pnet_reducer.rs index 3e7fb1b3b4..e519046354 100644 --- a/p2p/src/network/pnet/p2p_network_pnet_reducer.rs +++ b/p2p/src/network/pnet/p2p_network_pnet_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use salsa_simple::XSalsa20; use crate::{ diff --git a/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_actions.rs b/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_actions.rs index 64a78e5826..bca9b1e0a5 100644 --- a/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_actions.rs +++ b/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_actions.rs @@ -1,5 +1,5 @@ use crate::{ConnectionAddr, Data, P2pState}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_effects.rs b/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_effects.rs index 99c45d3c07..641dcedd86 100644 --- a/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_effects.rs +++ b/p2p/src/network/pnet_effectful/p2p_network_pnet_effectful_effects.rs @@ -1,4 +1,4 @@ -use openmina_core::fuzzed_maybe; +use mina_core::fuzzed_maybe; use super::P2pNetworkPnetEffectfulAction; use crate::{P2pMioService, P2pNetworkSelectAction, SelectKind}; diff --git a/p2p/src/network/pubsub/mod.rs b/p2p/src/network/pubsub/mod.rs index a9ebc12b9c..0e450ec82c 100644 --- a/p2p/src/network/pubsub/mod.rs +++ b/p2p/src/network/pubsub/mod.rs @@ -1,7 +1,7 @@ pub mod pb { include!(concat!(env!("OUT_DIR"), "/gossipsub.rs")); } -pub use openmina_core::p2p::P2pNetworkPubsubMessageCacheId; +pub use mina_core::p2p::P2pNetworkPubsubMessageCacheId; mod p2p_network_pubsub_actions; pub use self::p2p_network_pubsub_actions::P2pNetworkPubsubAction; @@ -17,12 +17,12 @@ mod p2p_network_pubsub_reducer; const TOPIC: &str = "coda/consensus-messages/0.0.1"; pub mod pubsub_effectful; -use openmina_core::snark::SnarkJobId; +use mina_core::snark::SnarkJobId; pub use pubsub_effectful::P2pNetworkPubsubEffectfulAction; use binprot::BinProtWrite; +use mina_core::bug_condition; use mina_p2p_messages::gossip::GossipNetMessageV2; -use openmina_core::bug_condition; use sha2::{Digest, Sha256}; use crate::identity::SecretKey; diff --git a/p2p/src/network/pubsub/p2p_network_pubsub_actions.rs b/p2p/src/network/pubsub/p2p_network_pubsub_actions.rs index 71caedc43a..56d18be4ad 100644 --- a/p2p/src/network/pubsub/p2p_network_pubsub_actions.rs +++ b/p2p/src/network/pubsub/p2p_network_pubsub_actions.rs @@ -1,7 +1,7 @@ use super::{pb, BroadcastMessageId}; use crate::{token::BroadcastAlgorithm, ConnectionAddr, Data, P2pState, PeerId, StreamId}; +use mina_core::{p2p::P2pNetworkPubsubMessageCacheId, ActionEvent}; use mina_p2p_messages::gossip::GossipNetMessageV2; -use openmina_core::{p2p::P2pNetworkPubsubMessageCacheId, ActionEvent}; use serde::{Deserialize, Serialize}; /// Actions that can occur within the P2P Network PubSub system. diff --git a/p2p/src/network/pubsub/p2p_network_pubsub_reducer.rs b/p2p/src/network/pubsub/p2p_network_pubsub_reducer.rs index 5a43766672..dfbe2f5b6a 100644 --- a/p2p/src/network/pubsub/p2p_network_pubsub_reducer.rs +++ b/p2p/src/network/pubsub/p2p_network_pubsub_reducer.rs @@ -1,13 +1,13 @@ use std::{collections::btree_map::Entry, time::Duration}; use binprot::BinProtRead; +use mina_core::{ + block::BlockWithHash, bug_condition, fuzz_maybe, fuzzed_maybe, snark::Snark, Substate, +}; use mina_p2p_messages::{ gossip::{self, GossipNetMessageV2}, v2::NetworkPoolSnarkPoolDiffVersionedStableV2, }; -use openmina_core::{ - block::BlockWithHash, bug_condition, fuzz_maybe, fuzzed_maybe, snark::Snark, Substate, -}; use redux::{Dispatcher, Timestamp}; use crate::{ diff --git a/p2p/src/network/pubsub/p2p_network_pubsub_state.rs b/p2p/src/network/pubsub/p2p_network_pubsub_state.rs index 8f5eecaa5d..2ed868d87b 100644 --- a/p2p/src/network/pubsub/p2p_network_pubsub_state.rs +++ b/p2p/src/network/pubsub/p2p_network_pubsub_state.rs @@ -2,12 +2,12 @@ use super::{pb, BroadcastMessageId}; use crate::{token::BroadcastAlgorithm, ConnectionAddr, PeerId, StreamId}; use libp2p_identity::ParseError; -use mina_p2p_messages::gossip::GossipNetMessageV2; -use openmina_core::{ +use mina_core::{ p2p::P2pNetworkPubsubMessageCacheId, snark::{Snark, SnarkJobId}, transaction::Transaction, }; +use mina_p2p_messages::gossip::GossipNetMessageV2; use redux::Timestamp; use serde::{Deserialize, Serialize}; use std::{ diff --git a/p2p/src/network/pubsub/pubsub_effectful/p2p_network_pubsub_effectful_actions.rs b/p2p/src/network/pubsub/pubsub_effectful/p2p_network_pubsub_effectful_actions.rs index 49a7fb8f3c..11bdfced09 100644 --- a/p2p/src/network/pubsub/pubsub_effectful/p2p_network_pubsub_effectful_actions.rs +++ b/p2p/src/network/pubsub/pubsub_effectful/p2p_network_pubsub_effectful_actions.rs @@ -1,5 +1,5 @@ use crate::{pubsub::pb::Message, ConnectionAddr, P2pState, PeerId}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; /// Eeffectful actions within the P2P Network PubSub system. diff --git a/p2p/src/network/rpc/p2p_network_rpc_actions.rs b/p2p/src/network/rpc/p2p_network_rpc_actions.rs index 3460063fee..de6b70ef22 100644 --- a/p2p/src/network/rpc/p2p_network_rpc_actions.rs +++ b/p2p/src/network/rpc/p2p_network_rpc_actions.rs @@ -1,5 +1,5 @@ +use mina_core::{action_debug, action_trace, ActionEvent}; use mina_p2p_messages::rpc_kernel::{QueryHeader, QueryID, ResponseHeader}; -use openmina_core::{action_debug, action_trace, ActionEvent}; use serde::{Deserialize, Serialize}; use super::{super::*, *}; @@ -169,7 +169,7 @@ fn log_message( peer_id: &PeerId, stream_id: &u32, ) where - T: openmina_core::log::EventContext, + T: mina_core::log::EventContext, { match message { RpcMessage::Handshake => action_trace!( diff --git a/p2p/src/network/rpc/p2p_network_rpc_reducer.rs b/p2p/src/network/rpc/p2p_network_rpc_reducer.rs index 1899fbdf5d..4ef0cf3434 100644 --- a/p2p/src/network/rpc/p2p_network_rpc_reducer.rs +++ b/p2p/src/network/rpc/p2p_network_rpc_reducer.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use binprot::BinProtRead; +use mina_core::{bug_condition, error, fuzz_maybe, fuzzed_maybe, Substate}; use mina_p2p_messages::{ rpc, rpc_kernel::{ @@ -10,7 +11,6 @@ use mina_p2p_messages::{ v2, versioned::Ver, }; -use openmina_core::{bug_condition, error, fuzz_maybe, fuzzed_maybe, Substate}; use redux::Dispatcher; use crate::{ diff --git a/p2p/src/network/scheduler/p2p_network_scheduler_actions.rs b/p2p/src/network/scheduler/p2p_network_scheduler_actions.rs index 1719fb34f5..7541e19dce 100644 --- a/p2p/src/network/scheduler/p2p_network_scheduler_actions.rs +++ b/p2p/src/network/scheduler/p2p_network_scheduler_actions.rs @@ -1,6 +1,6 @@ use std::net::{IpAddr, SocketAddr}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use super::{ diff --git a/p2p/src/network/scheduler/p2p_network_scheduler_reducer.rs b/p2p/src/network/scheduler/p2p_network_scheduler_reducer.rs index ccf05f7081..9c8ab40444 100644 --- a/p2p/src/network/scheduler/p2p_network_scheduler_reducer.rs +++ b/p2p/src/network/scheduler/p2p_network_scheduler_reducer.rs @@ -1,7 +1,7 @@ use std::{collections::BTreeMap, sync::OnceLock}; use identify::P2pNetworkIdentifyStreamAction; -use openmina_core::{bug_condition, error, warn, Substate}; +use mina_core::{bug_condition, error, warn, Substate}; use redux::Dispatcher; use request::{P2pNetworkKadRequestState, P2pNetworkKadRequestStatus}; use token::{ diff --git a/p2p/src/network/scheduler_effectful/p2p_network_scheduler_effectful_actions.rs b/p2p/src/network/scheduler_effectful/p2p_network_scheduler_effectful_actions.rs index b4cfba7ae0..ddb8724e5e 100644 --- a/p2p/src/network/scheduler_effectful/p2p_network_scheduler_effectful_actions.rs +++ b/p2p/src/network/scheduler_effectful/p2p_network_scheduler_effectful_actions.rs @@ -1,6 +1,6 @@ use std::net::{IpAddr, SocketAddr}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use crate::{ConnectionAddr, P2pNetworkConnectionCloseReason, P2pState}; diff --git a/p2p/src/network/select/p2p_network_select_actions.rs b/p2p/src/network/select/p2p_network_select_actions.rs index e8579e5b49..db72036dd1 100644 --- a/p2p/src/network/select/p2p_network_select_actions.rs +++ b/p2p/src/network/select/p2p_network_select_actions.rs @@ -1,6 +1,6 @@ use super::{super::*, *}; use crate::{Data, P2pState, PeerId}; -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)] diff --git a/p2p/src/network/select/p2p_network_select_reducer.rs b/p2p/src/network/select/p2p_network_select_reducer.rs index 9757f79ae6..65d9961b3e 100644 --- a/p2p/src/network/select/p2p_network_select_reducer.rs +++ b/p2p/src/network/select/p2p_network_select_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, error, fuzz_maybe, fuzzed_maybe, Substate}; +use mina_core::{bug_condition, error, fuzz_maybe, fuzzed_maybe, Substate}; use redux::Timestamp; use token::{ AuthKind, DiscoveryAlgorithm, IdentifyAlgorithm, MuxKind, Protocol, RpcAlgorithm, StreamKind, diff --git a/p2p/src/network/yamux/p2p_network_yamux_actions.rs b/p2p/src/network/yamux/p2p_network_yamux_actions.rs index f34166d421..eaab929ce2 100644 --- a/p2p/src/network/yamux/p2p_network_yamux_actions.rs +++ b/p2p/src/network/yamux/p2p_network_yamux_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::ActionEvent; +use mina_core::ActionEvent; use serde::{Deserialize, Serialize}; use super::p2p_network_yamux_state::{StreamId, YamuxFlags, YamuxFrame, YamuxPing}; diff --git a/p2p/src/network/yamux/p2p_network_yamux_reducer.rs b/p2p/src/network/yamux/p2p_network_yamux_reducer.rs index e3fbdb72c1..32cf903d78 100644 --- a/p2p/src/network/yamux/p2p_network_yamux_reducer.rs +++ b/p2p/src/network/yamux/p2p_network_yamux_reducer.rs @@ -1,6 +1,6 @@ use std::collections::VecDeque; -use openmina_core::{bug_condition, fuzz_maybe, fuzzed_maybe, Substate, SubstateAccess}; +use mina_core::{bug_condition, fuzz_maybe, fuzzed_maybe, Substate, SubstateAccess}; use crate::{ yamux::p2p_network_yamux_state::{YamuxFrame, YamuxFrameInner}, diff --git a/p2p/src/p2p_actions.rs b/p2p/src/p2p_actions.rs index 70c5a11b4a..9d9bf5bcfe 100644 --- a/p2p/src/p2p_actions.rs +++ b/p2p/src/p2p_actions.rs @@ -1,4 +1,4 @@ -use openmina_macros::ActionEvent; +use mina_macros::ActionEvent; use redux::EnablingCondition; use serde::{Deserialize, Serialize}; @@ -38,7 +38,7 @@ pub enum P2pEffectfulAction { pub enum P2pInitializeAction { /// Initializes p2p layer. #[action_event(level = info)] - Initialize { chain_id: openmina_core::ChainId }, + Initialize { chain_id: mina_core::ChainId }, } impl EnablingCondition for P2pInitializeAction { diff --git a/p2p/src/p2p_reducer.rs b/p2p/src/p2p_reducer.rs index 7b85ca71e7..8adda6b2ef 100644 --- a/p2p/src/p2p_reducer.rs +++ b/p2p/src/p2p_reducer.rs @@ -12,7 +12,7 @@ use crate::{ P2pNetworkPubsubAction, P2pNetworkRpcAction, P2pNetworkSelectAction, P2pNetworkState, P2pPeerState, P2pState, PeerId, }; -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::{ActionMeta, ActionWithMeta, Dispatcher, Timestamp}; impl P2pState { diff --git a/p2p/src/p2p_state.rs b/p2p/src/p2p_state.rs index f92221d50a..8edf9e5817 100644 --- a/p2p/src/p2p_state.rs +++ b/p2p/src/p2p_state.rs @@ -4,7 +4,7 @@ use std::{ time::Duration, }; -use openmina_core::{ +use mina_core::{ block::{ArcBlockWithHash, BlockWithHash}, impl_substate_access, requests::RpcId, @@ -71,8 +71,8 @@ impl P2pState { { let peer_id_str = my_id.to_libp2p_string(); - openmina_core::log::info!( - openmina_core::log::system_time(); + mina_core::log::info!( + mina_core::log::system_time(); kind = "P2pState new", summary = format!("Current node's id: {peer_id_str}"), peer_id_str = peer_id_str, @@ -387,13 +387,13 @@ impl P2pPeerState { false } else { #[cfg(not(test))] - openmina_core::bug_condition!( + mina_core::bug_condition!( "peer stuck in `P2pPeerStatus::Disconnecting` state?" ); #[cfg(test)] // in test, since time is virtual, timeout can pass before service finishes cleanup. // Hence it shouldn't be a bug condition in such case. - openmina_core::warn!(*time; "peer stuck in `P2pPeerStatus::Disconnecting` state?"); + mina_core::warn!(*time; "peer stuck in `P2pPeerStatus::Disconnecting` state?"); true } } @@ -502,11 +502,11 @@ impl P2pPeerStatusReady { } impl SubstateAccess for P2pState { - fn substate(&self) -> openmina_core::SubstateResult<&P2pState> { + fn substate(&self) -> mina_core::SubstateResult<&P2pState> { Ok(self) } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut P2pState> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut P2pState> { Ok(self) } } @@ -585,14 +585,14 @@ impl_substate_access!(P2pState, P2pNetworkSchedulerState, network.scheduler); impl_substate_access!(P2pState, P2pLimits, config.limits); impl SubstateAccess for P2pState { - fn substate(&self) -> openmina_core::SubstateResult<&P2pNetworkKadState> { + fn substate(&self) -> mina_core::SubstateResult<&P2pNetworkKadState> { self.network .scheduler .discovery_state() .ok_or_else(|| "kademlia state is unavailable".to_owned()) } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut P2pNetworkKadState> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut P2pNetworkKadState> { self.network .scheduler .discovery_state @@ -602,14 +602,14 @@ impl SubstateAccess for P2pState { } impl SubstateAccess for P2pState { - fn substate(&self) -> openmina_core::SubstateResult<&P2pNetworkKadBootstrapState> { + fn substate(&self) -> mina_core::SubstateResult<&P2pNetworkKadBootstrapState> { let kad_state: &P2pNetworkKadState = self.substate()?; kad_state .bootstrap_state() .ok_or_else(|| "bootstrap state is unavailable".to_owned()) } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut P2pNetworkKadBootstrapState> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut P2pNetworkKadBootstrapState> { let kad_state: &mut P2pNetworkKadState = self.substate_mut()?; kad_state .bootstrap_state_mut() diff --git a/p2p/src/peer/p2p_peer_actions.rs b/p2p/src/peer/p2p_peer_actions.rs index 2657043a1e..5a1449366c 100644 --- a/p2p/src/peer/p2p_peer_actions.rs +++ b/p2p/src/peer/p2p_peer_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{block::ArcBlockWithHash, ActionEvent}; +use mina_core::{block::ArcBlockWithHash, ActionEvent}; use serde::{Deserialize, Serialize}; use crate::{connection::outgoing::P2pConnectionOutgoingInitOpts, P2pState, PeerId}; diff --git a/p2p/src/peer/p2p_peer_reducer.rs b/p2p/src/peer/p2p_peer_reducer.rs index ec10196a22..55839299a7 100644 --- a/p2p/src/peer/p2p_peer_reducer.rs +++ b/p2p/src/peer/p2p_peer_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate}; +use mina_core::{bug_condition, Substate}; use redux::{ActionWithMeta, Timestamp}; use crate::{P2pPeerState, P2pPeerStatus, P2pPeerStatusReady, P2pState}; diff --git a/p2p/src/service_impl/mio/mod.rs b/p2p/src/service_impl/mio/mod.rs index 2780dbabb6..8a39b34c7a 100644 --- a/p2p/src/service_impl/mio/mod.rs +++ b/p2p/src/service_impl/mio/mod.rs @@ -11,7 +11,7 @@ use std::{ use libp2p_identity::Keypair; use mio::net::{TcpListener, TcpStream}; -use openmina_core::{bug_condition, channels::mpsc}; +use mina_core::{bug_condition, channels::mpsc}; use thiserror::Error; use crate::{ConnectionAddr, MioCmd, MioEvent}; @@ -32,8 +32,8 @@ enum MioError { impl MioError { fn report(self) { - openmina_core::log::error!( - openmina_core::log::system_time(); + mina_core::log::error!( + mina_core::log::system_time(); kind = "MioError", summary = self.to_string(), ); @@ -75,7 +75,7 @@ impl MioService { MioService::Ready(MioRunningService::run(event_sender, keypair.clone())) } _ => { - openmina_core::warn!(openmina_core::log::system_time(); "tried to run already running mio service"); + mina_core::warn!(mina_core::log::system_time(); "tried to run already running mio service"); return; } } @@ -238,18 +238,18 @@ where self.send(MioEvent::ConnectionDidClose(addr, Err(e.to_string()))); } Ok(None) => { - openmina_core::error!( - openmina_core::log::system_time(); + mina_core::error!( + mina_core::log::system_time(); summary = "mio error event without actual error", - addr = openmina_core::log::inner::field::display(addr), + addr = mina_core::log::inner::field::display(addr), ); } Err(e) => { - openmina_core::error!( - openmina_core::log::system_time(); + mina_core::error!( + mina_core::log::system_time(); summary = "error getting mio error", - error = openmina_core::log::inner::field::display(e), - addr = openmina_core::log::inner::field::display(addr), + error = mina_core::log::inner::field::display(e), + addr = mina_core::log::inner::field::display(addr), ); } } @@ -491,8 +491,8 @@ where // TODO: upper bound? resize to `limit` or try to allocate some extra space too? self.recv_buf.resize(limit, 0); - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); summary = format!("Increasing buffer size to {}kb", limit / 1024) ); } diff --git a/p2p/src/service_impl/mod.rs b/p2p/src/service_impl/mod.rs index dc3c2af078..a8eeca95a2 100644 --- a/p2p/src/service_impl/mod.rs +++ b/p2p/src/service_impl/mod.rs @@ -16,7 +16,7 @@ pub trait TaskSpawner: Send + Clone { pub mod webrtc { use std::collections::BTreeMap; - use openmina_core::channels::mpsc; + use mina_core::channels::mpsc; use crate::{ channels::{ChannelId, ChannelMsg, MsgId}, diff --git a/p2p/src/service_impl/webrtc/api.rs b/p2p/src/service_impl/webrtc/api.rs index 0935ad4b00..6633ff815c 100644 --- a/p2p/src/service_impl/webrtc/api.rs +++ b/p2p/src/service_impl/webrtc/api.rs @@ -1,6 +1,6 @@ use std::{collections::BTreeMap, sync::Arc}; -use openmina_core::channels::broadcast; +use mina_core::channels::broadcast; use tokio::sync::Mutex; use crate::PeerId; diff --git a/p2p/src/service_impl/webrtc/mod.rs b/p2p/src/service_impl/webrtc/mod.rs index b50058c1fa..abe1375b8d 100644 --- a/p2p/src/service_impl/webrtc/mod.rs +++ b/p2p/src/service_impl/webrtc/mod.rs @@ -7,7 +7,7 @@ mod webrtc_rs; use std::{collections::BTreeMap, future::Future, pin::Pin, sync::Arc, time::Duration}; -use openmina_core::bug_condition; +use mina_core::bug_condition; use serde::Serialize; use tokio::sync::Semaphore; @@ -16,7 +16,7 @@ use tokio::task::spawn_local; #[cfg(target_arch = "wasm32")] use wasm_bindgen_futures::spawn_local; -use openmina_core::channels::{mpsc, oneshot, Aborted, Aborter}; +use mina_core::channels::{mpsc, oneshot, Aborted, Aborter}; use crate::{ channels::{ChannelId, ChannelMsg, MsgId}, @@ -161,7 +161,7 @@ impl Default for RTCConfigIceServers { Self(vec![ RTCConfigIceServer { urls: vec!["stun:65.109.110.75:3478".to_owned()], - username: Some("openmina".to_owned()), + username: Some("mina".to_owned()), credential: Some("webrtc".to_owned()), }, RTCConfigIceServer { @@ -868,7 +868,7 @@ pub trait P2pServiceWebrtc: redux::Service { // return false; // } } else { - openmina_core::error!(openmina_core::log::system_time(); "`disconnect` shouldn't be used for libp2p peers"); + mina_core::error!(mina_core::log::system_time(); "`disconnect` shouldn't be used for libp2p peers"); } true } diff --git a/p2p/src/service_impl/webrtc/web.rs b/p2p/src/service_impl/webrtc/web.rs index 032078a7bc..47e414fb28 100644 --- a/p2p/src/service_impl/webrtc/web.rs +++ b/p2p/src/service_impl/webrtc/web.rs @@ -13,7 +13,7 @@ use web_sys::{ RtcSessionDescriptionInit, }; -use openmina_core::channels::oneshot; +use mina_core::channels::oneshot; use crate::{ connection::P2pConnectionResponse, @@ -184,7 +184,7 @@ impl RTCChannel { let data = uarray.to_vec(); spawn_local(f(data.as_ref())); } else { - openmina_core::log::error!(redux::Timestamp::global_now(); "`event.data()` failed to cast to `ArrayBuffer`. {:?}", event.data()); + mina_core::log::error!(redux::Timestamp::global_now(); "`event.data()` failed to cast to `ArrayBuffer`. {:?}", event.data()); } }, ); diff --git a/p2p/src/service_impl/webrtc/webrtc_cpp.rs b/p2p/src/service_impl/webrtc/webrtc_cpp.rs index c83367b581..5f030e82a9 100644 --- a/p2p/src/service_impl/webrtc/webrtc_cpp.rs +++ b/p2p/src/service_impl/webrtc/webrtc_cpp.rs @@ -5,7 +5,7 @@ use datachannel::{ PeerConnectionHandler, Reliability, RtcConfig, RtcDataChannel, RtcPeerConnection, SdpType, SessionDescription, }; -use openmina_core::channels::{oneshot, watch}; +use mina_core::channels::{oneshot, watch}; use tokio::task::spawn_local; use crate::{ diff --git a/p2p/src/service_impl/webrtc/webrtc_rs.rs b/p2p/src/service_impl/webrtc/webrtc_rs.rs index ce87ed9be4..96c48aae04 100644 --- a/p2p/src/service_impl/webrtc/webrtc_rs.rs +++ b/p2p/src/service_impl/webrtc/webrtc_rs.rs @@ -127,8 +127,8 @@ impl RTCConnection { pub async fn close(self) { if let Err(error) = self.0.close().await { - openmina_core::warn!( - openmina_core::log::system_time(); + mina_core::warn!( + mina_core::log::system_time(); summary = "CONNECTION LEAK: Failure when closing RTCConnection", error = error.to_string(), ) diff --git a/p2p/src/service_impl/webrtc_with_libp2p.rs b/p2p/src/service_impl/webrtc_with_libp2p.rs index cd384cb5fa..1eb6645206 100644 --- a/p2p/src/service_impl/webrtc_with_libp2p.rs +++ b/p2p/src/service_impl/webrtc_with_libp2p.rs @@ -99,7 +99,7 @@ impl P2pConnectionService for T { Host::Ipv4(ip4) => ip4.into(), Host::Ipv6(ip6) => ip6.into(), host => { - openmina_core::error!(openmina_core::log::system_time(); "unsupported host for internal libp2p: {host}"); + mina_core::error!(mina_core::log::system_time(); "unsupported host for internal libp2p: {host}"); return; } }; @@ -212,7 +212,7 @@ where impl P2pServiceCtx { pub fn mocked(sec_key: SecretKey) -> Self { - use openmina_core::channels::mpsc; + use mina_core::channels::mpsc; Self { sec_key: sec_key.clone(), #[cfg(feature = "p2p-libp2p")] diff --git a/p2p/src/webrtc/connection_auth.rs b/p2p/src/webrtc/connection_auth.rs index 1c31f59acc..a6765e2480 100644 --- a/p2p/src/webrtc/connection_auth.rs +++ b/p2p/src/webrtc/connection_auth.rs @@ -88,7 +88,7 @@ use super::{Answer, Offer}; /// ## Usage /// /// ```rust -/// use openmina_p2p::webrtc::{ConnectionAuth, Offer, Answer}; +/// use mina_p2p::webrtc::{ConnectionAuth, Offer, Answer}; /// /// let connection_auth = ConnectionAuth::new(&offer, &answer); /// let encrypted_auth = connection_auth.encrypt(&my_secret_key, &peer_public_key, rng)?; @@ -158,7 +158,7 @@ impl ConnectionAuth { /// # Example /// /// ```rust - /// use openmina_p2p::webrtc::ConnectionAuth; + /// use mina_p2p::webrtc::ConnectionAuth; /// /// let auth = ConnectionAuth::new(&offer, &answer); /// // Use auth for connection verification diff --git a/p2p/src/webrtc/signal.rs b/p2p/src/webrtc/signal.rs index 0da4447b21..83abe7b47b 100644 --- a/p2p/src/webrtc/signal.rs +++ b/p2p/src/webrtc/signal.rs @@ -37,7 +37,7 @@ use binprot_derive::{BinProtRead, BinProtWrite}; use derive_more::From; use malloc_size_of_derive::MallocSizeOf; -use openmina_core::ChainId; +use mina_core::ChainId; use serde::{Deserialize, Serialize}; use crate::identity::{EncryptableType, PeerId, PublicKey}; diff --git a/p2p/testing/Cargo.toml b/p2p/testing/Cargo.toml index da38d2513f..a5f10685b0 100644 --- a/p2p/testing/Cargo.toml +++ b/p2p/testing/Cargo.toml @@ -27,7 +27,7 @@ libp2p = { workspace = true, features = [ "kad", ] } libp2p-rpc-behaviour = { path = "../libp2p-rpc-behaviour" } -openmina-core = { path = "../../core" } +mina-core = { path = "../../core" } pin-project-lite = "0.2" rand = "0.8.5" serde_json.workspace = true diff --git a/p2p/testing/src/cluster.rs b/p2p/testing/src/cluster.rs index c6c0159927..b17266b427 100644 --- a/p2p/testing/src/cluster.rs +++ b/p2p/testing/src/cluster.rs @@ -8,7 +8,7 @@ use std::{ use futures::StreamExt; use libp2p::{multiaddr::multiaddr, swarm::DialError, Multiaddr}; -use openmina_core::{channels::mpsc, ChainId, Substate, DEVNET_CHAIN_ID}; +use mina_core::{channels::mpsc, ChainId, Substate, DEVNET_CHAIN_ID}; use p2p::{ connection::outgoing::{ P2pConnectionOutgoingAction, P2pConnectionOutgoingInitLibp2pOpts, @@ -163,7 +163,7 @@ impl ClusterBuilder { let last_idle_instant = idle_interval.tick().await.into_std(); let is_error = self.is_error; let total_duration = self.total_duration; - openmina_core::info!(openmina_core::log::system_time(); "starting the cluster"); + mina_core::info!(mina_core::log::system_time(); "starting the cluster"); let next_poll = Default::default(); Ok(Cluster { chain_id, @@ -397,7 +397,7 @@ impl Cluster { }; if let Err(error) = result { - openmina_core::warn!(time; "error = {error}"); + mina_core::warn!(time; "error = {error}"); } }), override_fn.unwrap_or(|store, action| { diff --git a/p2p/testing/src/libp2p_node.rs b/p2p/testing/src/libp2p_node.rs index 9e455ef367..ffee04ae26 100644 --- a/p2p/testing/src/libp2p_node.rs +++ b/p2p/testing/src/libp2p_node.rs @@ -5,8 +5,8 @@ use libp2p::{ swarm::{NetworkBehaviour, SwarmEvent, THandlerErr}, Transport, }; +use mina_core::ChainId; use mina_p2p_messages::rpc_kernel::RpcTag; -use openmina_core::ChainId; use p2p::PeerId; use libp2p_rpc_behaviour::StreamId; diff --git a/p2p/testing/src/log.rs b/p2p/testing/src/log.rs index 268e822618..4787c237ad 100644 --- a/p2p/testing/src/log.rs +++ b/p2p/testing/src/log.rs @@ -1,6 +1,6 @@ use std::{env, sync::atomic::AtomicBool}; -use openmina_core::log::inner::Level; +use mina_core::log::inner::Level; use tracing::Subscriber; use tracing_subscriber::{layer::SubscriberExt, Layer}; @@ -29,7 +29,7 @@ where } fn initialize_logging() { - let level = std::env::var("OPENMINA_TRACING_LEVEL") + let level = std::env::var("MINA_TRACING_LEVEL") .ok() .and_then(|level| match level.parse() { Ok(v) => Some(v), @@ -54,7 +54,7 @@ fn initialize_logging() { tracing::subscriber::set_global_default(subscriber) .expect("global subscriber should be configurable"); - if env::var("OPENMINA_LOG_TRACER") + if env::var("MINA_LOG_TRACER") .ok() .and_then(|var| var.parse::().ok()) .unwrap_or_default() diff --git a/p2p/testing/src/redux.rs b/p2p/testing/src/redux.rs index 065971848a..4252cb1e7e 100644 --- a/p2p/testing/src/redux.rs +++ b/p2p/testing/src/redux.rs @@ -1,4 +1,4 @@ -use openmina_core::{ +use mina_core::{ impl_substate_access, log::{ inner::{ @@ -105,13 +105,13 @@ impl_substate_access!(State, P2pState, 0); macro_rules! impl_p2p_state_access { ($state:ty, $substate_type:ty) => { - impl openmina_core::SubstateAccess<$substate_type> for $state { - fn substate(&self) -> openmina_core::SubstateResult<&$substate_type> { + impl mina_core::SubstateAccess<$substate_type> for $state { + fn substate(&self) -> mina_core::SubstateResult<&$substate_type> { let substate: &P2pState = self.substate()?; substate.substate() } - fn substate_mut(&mut self) -> openmina_core::SubstateResult<&mut $substate_type> { + fn substate_mut(&mut self) -> mina_core::SubstateResult<&mut $substate_type> { let substate: &mut P2pState = self.substate_mut()?; substate.substate_mut() } diff --git a/p2p/testing/src/rust_node.rs b/p2p/testing/src/rust_node.rs index 7b5bde8d57..d5c3de8877 100644 --- a/p2p/testing/src/rust_node.rs +++ b/p2p/testing/src/rust_node.rs @@ -5,7 +5,7 @@ use std::{ }; use futures::Stream; -use openmina_core::channels::mpsc; +use mina_core::channels::mpsc; use p2p::{P2pAction, P2pEvent, P2pLimits, P2pState, P2pTimeouts, PeerId}; use redux::{Effects, EnablingCondition, Reducer, SubStore}; diff --git a/p2p/testing/src/service.rs b/p2p/testing/src/service.rs index 4789e19e05..881da75f57 100644 --- a/p2p/testing/src/service.rs +++ b/p2p/testing/src/service.rs @@ -1,6 +1,6 @@ use std::{collections::VecDeque, time::Instant}; -use openmina_core::channels::mpsc; +use mina_core::channels::mpsc; use p2p::{ identity::SecretKey, service_impl::{ diff --git a/p2p/tests/kademlia.rs b/p2p/tests/kademlia.rs index 3b93112ea2..4ac42e72b9 100644 --- a/p2p/tests/kademlia.rs +++ b/p2p/tests/kademlia.rs @@ -1,4 +1,4 @@ -use openmina_core::Substate; +use mina_core::Substate; use p2p::{ identity::SecretKey, P2pAction, P2pNetworkAction, P2pNetworkKadAction, P2pNetworkKadBucket, P2pNetworkKademliaAction, P2pNetworkKademliaRpcReply, P2pNetworkKademliaStreamAction, P2pState, @@ -23,7 +23,7 @@ use std::{future::ready, net::Ipv4Addr, time::Duration}; #[tokio::test] async fn kademlia_routing_table() { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let mut cluster = ClusterBuilder::new() .ports_with_len(10) @@ -111,7 +111,7 @@ async fn kademlia_routing_table() { #[tokio::test] async fn kademlia_incoming_routing_table() { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let mut cluster = ClusterBuilder::new() .ports_with_len(10) @@ -230,7 +230,7 @@ async fn bootstrap_no_peers() -> anyhow::Result<()> { /// A node should be able to discover and connect a node connected to the seed node. #[tokio::test] async fn discovery_seed_single_peer() -> anyhow::Result<()> { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", false.to_string()); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", false.to_string()); let mut cluster = ClusterBuilder::new() .ports_with_len(6) .idle_duration(Duration::from_millis(100)) @@ -265,7 +265,7 @@ async fn discovery_seed_single_peer() -> anyhow::Result<()> { #[tokio::test] async fn discovery_seed_multiple_peers() -> anyhow::Result<()> { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", false.to_string()); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", false.to_string()); const PEERS: usize = 15; let mut cluster = ClusterBuilder::new() .ports_with_len(PEERS as u16 * 2 + 4) @@ -313,7 +313,7 @@ async fn discovery_seed_multiple_peers() -> anyhow::Result<()> { #[tokio::test] async fn test_bad_node() -> anyhow::Result<()> { - std::env::set_var("OPENMINA_DISCOVERY_FILTER_ADDR", "false"); + std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "false"); let mut cluster = ClusterBuilder::new() .ports_with_len(100) @@ -398,7 +398,7 @@ fn bad_node_reducer( Substate::new(state, dispatcher), meta.with_action(action.clone()), ) { - openmina_core::warn!(time; "error = {error}"); + mina_core::warn!(time; "error = {error}"); } } Action::Idle(_) | Action::P2pEffectful(_) => {} diff --git a/producer-dashboard/Cargo.toml b/producer-dashboard/Cargo.toml index 0bc8f0000a..a4f40916b5 100644 --- a/producer-dashboard/Cargo.toml +++ b/producer-dashboard/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "openmina-producer-dashboard" +name = "mina-producer-dashboard" version = "0.16.0" edition = "2021" license = "Apache-2.0" [[bin]] -name = "openmina-producer-dashboard" +name = "mina-producer-dashboard" path = "src/bin/producer_dashboard.rs" [dependencies] @@ -13,10 +13,10 @@ bincode = "1.3.3" clap = { version = "4.5", features = ["derive"] } dotenvy = "0.15" graphql_client = { version = "0.14", features = ["reqwest"] } +mina-node-account = { workspace = true } mina-p2p-messages = { workspace = true } num-bigint = "0.4" num-traits = "0.2" -openmina-node-account = { workspace = true } reqwest = { version = "0.11", features = ["json"] } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0.83" } diff --git a/producer-dashboard/src/bin/producer_dashboard.rs b/producer-dashboard/src/bin/producer_dashboard.rs index ee4c69a69b..99c67a7900 100644 --- a/producer-dashboard/src/bin/producer_dashboard.rs +++ b/producer-dashboard/src/bin/producer_dashboard.rs @@ -1,5 +1,5 @@ -use openmina_node_account::AccountSecretKey; -use openmina_producer_dashboard::{ +use mina_node_account::AccountSecretKey; +use mina_producer_dashboard::{ archive::watchdog::ArchiveWatchdog, config, evaluator::{EpochInit, Evaluator}, diff --git a/producer-dashboard/src/evaluator/mod.rs b/producer-dashboard/src/evaluator/mod.rs index 3a45bfb159..be80ffd11e 100644 --- a/producer-dashboard/src/evaluator/mod.rs +++ b/producer-dashboard/src/evaluator/mod.rs @@ -1,7 +1,7 @@ use std::str::FromStr; +use mina_node_account::AccountSecretKey; use mina_p2p_messages::v2::EpochSeed; -use openmina_node_account::AccountSecretKey; use tokio::{sync::mpsc::UnboundedReceiver, task::JoinHandle}; use vrf::{VrfEvaluationInput, VrfEvaluationOutput}; diff --git a/snark/Cargo.toml b/snark/Cargo.toml index afa772856e..bf3309e1b6 100644 --- a/snark/Cargo.toml +++ b/snark/Cargo.toml @@ -32,7 +32,7 @@ sha2 = "0.10" strum_macros = "0.26" thiserror = "1.0.50" -openmina-core = { path = "../core" } +mina-core = { path = "../core" } [dev-dependencies] diff --git a/snark/src/block_verify/mod.rs b/snark/src/block_verify/mod.rs index e28dd0b196..ab620ebb63 100644 --- a/snark/src/block_verify/mod.rs +++ b/snark/src/block_verify/mod.rs @@ -14,7 +14,7 @@ pub use crate::block_verify_effectful::{ use serde::{Deserialize, Serialize}; use std::sync::Arc; -use openmina_core::block::{Block, BlockHash, BlockHeader, BlockHeaderWithHash, BlockWithHash}; +use mina_core::block::{Block, BlockHash, BlockHeader, BlockHeaderWithHash, BlockWithHash}; #[derive(derive_more::From, Serialize, Deserialize, Debug, Clone)] pub enum VerifiableBlockWithHash { diff --git a/snark/src/block_verify/snark_block_verify_actions.rs b/snark/src/block_verify/snark_block_verify_actions.rs index 0ef82dfc67..11ac5c71eb 100644 --- a/snark/src/block_verify/snark_block_verify_actions.rs +++ b/snark/src/block_verify/snark_block_verify_actions.rs @@ -1,4 +1,4 @@ -use openmina_core::{block::BlockHash, ActionEvent, SubstateAccess}; +use mina_core::{block::BlockHash, ActionEvent, SubstateAccess}; use serde::{Deserialize, Serialize}; use super::{SnarkBlockVerifyError, SnarkBlockVerifyId, VerifiableBlockWithHash}; diff --git a/snark/src/block_verify/snark_block_verify_reducer.rs b/snark/src/block_verify/snark_block_verify_reducer.rs index be207568d1..b58ec27bf4 100644 --- a/snark/src/block_verify/snark_block_verify_reducer.rs +++ b/snark/src/block_verify/snark_block_verify_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{Substate, SubstateAccess}; +use mina_core::{Substate, SubstateAccess}; use redux::EnablingCondition; use crate::block_verify_effectful::SnarkBlockVerifyEffectfulAction; diff --git a/snark/src/block_verify/snark_block_verify_state.rs b/snark/src/block_verify/snark_block_verify_state.rs index bb862c855a..d385749599 100644 --- a/snark/src/block_verify/snark_block_verify_state.rs +++ b/snark/src/block_verify/snark_block_verify_state.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use serde::{Deserialize, Serialize}; -use openmina_core::{block::BlockHash, requests::PendingRequests}; +use mina_core::{block::BlockHash, requests::PendingRequests}; use crate::{BlockVerifier, VerifierSRS}; diff --git a/snark/src/block_verify_effectful/mod.rs b/snark/src/block_verify_effectful/mod.rs index 3aa5504f5c..03431838a1 100644 --- a/snark/src/block_verify_effectful/mod.rs +++ b/snark/src/block_verify_effectful/mod.rs @@ -9,13 +9,13 @@ pub use snark_block_verify_service::*; use serde::{Deserialize, Serialize}; pub struct SnarkBlockVerifyIdType; -impl openmina_core::requests::RequestIdType for SnarkBlockVerifyIdType { +impl mina_core::requests::RequestIdType for SnarkBlockVerifyIdType { fn request_id_type() -> &'static str { "SnarkBlockVerifyId" } } -pub type SnarkBlockVerifyId = openmina_core::requests::RequestId; +pub type SnarkBlockVerifyId = mina_core::requests::RequestId; #[derive(Serialize, Deserialize, Debug, Clone)] pub enum SnarkBlockVerifyError { diff --git a/snark/src/snark_reducer.rs b/snark/src/snark_reducer.rs index 1449e9b712..1e3d4c11db 100644 --- a/snark/src/snark_reducer.rs +++ b/snark/src/snark_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{Substate, SubstateAccess}; +use mina_core::{Substate, SubstateAccess}; use redux::EnablingCondition; use crate::{ diff --git a/snark/src/user_command_verify/snark_user_command_verify_actions.rs b/snark/src/user_command_verify/snark_user_command_verify_actions.rs index 294ebda6e0..00ac444e58 100644 --- a/snark/src/user_command_verify/snark_user_command_verify_actions.rs +++ b/snark/src/user_command_verify/snark_user_command_verify_actions.rs @@ -2,7 +2,7 @@ use ledger::scan_state::transaction_logic::{valid, verifiable, WithStatus}; use redux::Callback; use serde::{Deserialize, Serialize}; -use openmina_core::{transaction::TransactionPoolMessageSource, ActionEvent}; +use mina_core::{transaction::TransactionPoolMessageSource, ActionEvent}; use super::{SnarkUserCommandVerifyError, SnarkUserCommandVerifyId}; diff --git a/snark/src/user_command_verify/snark_user_command_verify_reducer.rs b/snark/src/user_command_verify/snark_user_command_verify_reducer.rs index 182fc3c609..d7a4aa78d4 100644 --- a/snark/src/user_command_verify/snark_user_command_verify_reducer.rs +++ b/snark/src/user_command_verify/snark_user_command_verify_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, Substate, SubstateAccess}; +use mina_core::{bug_condition, Substate, SubstateAccess}; use redux::EnablingCondition; use crate::user_command_verify_effectful::SnarkUserCommandVerifyEffectfulAction; diff --git a/snark/src/user_command_verify/snark_user_command_verify_state.rs b/snark/src/user_command_verify/snark_user_command_verify_state.rs index eef2697e49..b2e41ae297 100644 --- a/snark/src/user_command_verify/snark_user_command_verify_state.rs +++ b/snark/src/user_command_verify/snark_user_command_verify_state.rs @@ -4,7 +4,7 @@ use ledger::scan_state::transaction_logic::{valid, verifiable, WithStatus}; use redux::Callback; use serde::{Deserialize, Serialize}; -use openmina_core::{requests::PendingRequests, transaction::TransactionPoolMessageSource}; +use mina_core::{requests::PendingRequests, transaction::TransactionPoolMessageSource}; use crate::{TransactionVerifier, VerifierSRS}; diff --git a/snark/src/user_command_verify_effectful/mod.rs b/snark/src/user_command_verify_effectful/mod.rs index 2866ef34e9..1b818ebe14 100644 --- a/snark/src/user_command_verify_effectful/mod.rs +++ b/snark/src/user_command_verify_effectful/mod.rs @@ -9,14 +9,13 @@ pub use snark_user_command_verify_service::*; use serde::{Deserialize, Serialize}; pub struct SnarkUserCommandVerifyIdType; -impl openmina_core::requests::RequestIdType for SnarkUserCommandVerifyIdType { +impl mina_core::requests::RequestIdType for SnarkUserCommandVerifyIdType { fn request_id_type() -> &'static str { "SnarkUserCommandVerifyId" } } -pub type SnarkUserCommandVerifyId = - openmina_core::requests::RequestId; +pub type SnarkUserCommandVerifyId = mina_core::requests::RequestId; #[derive(Serialize, Deserialize, Debug, Clone, thiserror::Error)] pub enum SnarkUserCommandVerifyError { diff --git a/snark/src/work_verify/snark_work_verify_actions.rs b/snark/src/work_verify/snark_work_verify_actions.rs index 286cdaccab..31f43d875e 100644 --- a/snark/src/work_verify/snark_work_verify_actions.rs +++ b/snark/src/work_verify/snark_work_verify_actions.rs @@ -1,7 +1,7 @@ -use openmina_core::{snark::SnarkJobId, SubstateAccess}; +use mina_core::{snark::SnarkJobId, SubstateAccess}; use serde::{Deserialize, Serialize}; -use openmina_core::{snark::Snark, ActionEvent}; +use mina_core::{snark::Snark, ActionEvent}; use super::{SnarkWorkVerifyError, SnarkWorkVerifyId}; diff --git a/snark/src/work_verify/snark_work_verify_reducer.rs b/snark/src/work_verify/snark_work_verify_reducer.rs index ec4d4bab89..e9ddaaee99 100644 --- a/snark/src/work_verify/snark_work_verify_reducer.rs +++ b/snark/src/work_verify/snark_work_verify_reducer.rs @@ -1,4 +1,4 @@ -use openmina_core::{bug_condition, snark::Snark, Substate, SubstateAccess}; +use mina_core::{bug_condition, snark::Snark, Substate, SubstateAccess}; use redux::EnablingCondition; use crate::work_verify_effectful::SnarkWorkVerifyEffectfulAction; diff --git a/snark/src/work_verify/snark_work_verify_state.rs b/snark/src/work_verify/snark_work_verify_state.rs index 4ee887a4dc..b85be171e3 100644 --- a/snark/src/work_verify/snark_work_verify_state.rs +++ b/snark/src/work_verify/snark_work_verify_state.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use serde::{Deserialize, Serialize}; -use openmina_core::{ +use mina_core::{ requests::PendingRequests, snark::{Snark, SnarkJobId}, }; diff --git a/snark/src/work_verify_effectful/mod.rs b/snark/src/work_verify_effectful/mod.rs index 0814ccdddb..a3fd590aeb 100644 --- a/snark/src/work_verify_effectful/mod.rs +++ b/snark/src/work_verify_effectful/mod.rs @@ -9,13 +9,13 @@ pub use snark_work_verify_service::*; use serde::{Deserialize, Serialize}; pub struct SnarkWorkVerifyIdType; -impl openmina_core::requests::RequestIdType for SnarkWorkVerifyIdType { +impl mina_core::requests::RequestIdType for SnarkWorkVerifyIdType { fn request_id_type() -> &'static str { "SnarkWorkVerifyId" } } -pub type SnarkWorkVerifyId = openmina_core::requests::RequestId; +pub type SnarkWorkVerifyId = mina_core::requests::RequestId; #[derive(Serialize, Deserialize, Debug, Clone, thiserror::Error)] pub enum SnarkWorkVerifyError { diff --git a/snark/src/work_verify_effectful/snark_work_verify_effectful_actions.rs b/snark/src/work_verify_effectful/snark_work_verify_effectful_actions.rs index 6234b3e715..46175ae684 100644 --- a/snark/src/work_verify_effectful/snark_work_verify_effectful_actions.rs +++ b/snark/src/work_verify_effectful/snark_work_verify_effectful_actions.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use openmina_core::snark::Snark; +use mina_core::snark::Snark; use serde::{Deserialize, Serialize}; use crate::{TransactionVerifier, VerifierSRS}; diff --git a/snark/src/work_verify_effectful/snark_work_verify_service.rs b/snark/src/work_verify_effectful/snark_work_verify_service.rs index fdcb475ebb..a275058156 100644 --- a/snark/src/work_verify_effectful/snark_work_verify_service.rs +++ b/snark/src/work_verify_effectful/snark_work_verify_service.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use openmina_core::snark::Snark; +use mina_core::snark::Snark; use crate::{TransactionVerifier, VerifierSRS}; diff --git a/tools/archive-breadcrumb-compare/Cargo.toml b/tools/archive-breadcrumb-compare/Cargo.toml index 2f7888c724..fd70da7851 100644 --- a/tools/archive-breadcrumb-compare/Cargo.toml +++ b/tools/archive-breadcrumb-compare/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-archive-breadcrumb-compare" +name = "mina-archive-breadcrumb-compare" version = "0.16.0" edition = "2021" diff --git a/tools/archive-breadcrumb-compare/src/main.rs b/tools/archive-breadcrumb-compare/src/main.rs index ca1879781b..4bb8860449 100644 --- a/tools/archive-breadcrumb-compare/src/main.rs +++ b/tools/archive-breadcrumb-compare/src/main.rs @@ -18,11 +18,11 @@ struct Args { ocaml_node_dir: PathBuf, /// Openmina Node GraphQL endpoint - #[arg(env = "OPENMINA_NODE_GRAPHQL")] + #[arg(env = "MINA_NODE_GRAPHQL")] openmina_node_graphql: Option, /// Openmina Node directory path - #[arg(env = "OPENMINA_NODE_DIR", required = true)] + #[arg(env = "MINA_NODE_DIR", required = true)] openmina_node_dir: PathBuf, /// Check for missing breadcrumbs diff --git a/tools/bootstrap-sandbox/Cargo.toml b/tools/bootstrap-sandbox/Cargo.toml index e94f6da5f7..bd4c7f67e7 100644 --- a/tools/bootstrap-sandbox/Cargo.toml +++ b/tools/bootstrap-sandbox/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-bootstrap-sandbox" +name = "mina-bootstrap-sandbox" version = "0.16.0" edition = "2021" @@ -20,8 +20,8 @@ tokio = { version = "1.37", features = ["macros", "rt-multi-thread"] } binprot = { git = "https://github.com/openmina/binprot-rs", rev = "400b52c" } ledger = { path = "../../ledger", package = "mina-tree" } libp2p-rpc-behaviour = { path = "../../p2p/libp2p-rpc-behaviour" } +mina-core = { path = "../../core" } mina-transport = { path = "../transport" } -openmina-core = { path = "../../core" } libp2p = { workspace = true, features = ["identify", "macros"] } mina-curves = { workspace = true } diff --git a/tools/bootstrap-sandbox/src/bootstrap.rs b/tools/bootstrap-sandbox/src/bootstrap.rs index eb1c821e7a..cfa375f89f 100644 --- a/tools/bootstrap-sandbox/src/bootstrap.rs +++ b/tools/bootstrap-sandbox/src/bootstrap.rs @@ -7,6 +7,7 @@ use ledger::{ staged_ledger::{diff::Diff, staged_ledger::StagedLedger}, verifier::Verifier, }; +use mina_core::constants::constraint_constants; use mina_curves::pasta::Fp; use mina_p2p_messages::{ rpc::{GetBestTipV2, GetStagedLedgerAuxAndPendingCoinbasesAtHashV2Response}, @@ -14,7 +15,6 @@ use mina_p2p_messages::{ v2, }; use mina_signer::CompressedPubKey; -use openmina_core::constants::constraint_constants; use super::snarked_ledger::SnarkedLedger; diff --git a/tools/bootstrap-sandbox/src/main.rs b/tools/bootstrap-sandbox/src/main.rs index f53293035b..febef52213 100644 --- a/tools/bootstrap-sandbox/src/main.rs +++ b/tools/bootstrap-sandbox/src/main.rs @@ -75,7 +75,7 @@ async fn main() { cmd, } = Args::from_args(); - let sk = env::var("OPENMINA_P2P_SEC_KEY") + let sk = env::var("MINA_P2P_SEC_KEY") .map(|key| { let mut bytes = bs58::decode(key).with_check(Some(0x80)).into_vec().unwrap(); SecretKey::try_from_bytes(&mut bytes[1..]).unwrap() diff --git a/tools/fuzzing/Cargo.toml b/tools/fuzzing/Cargo.toml index 0a532e297e..659bd7657f 100644 --- a/tools/fuzzing/Cargo.toml +++ b/tools/fuzzing/Cargo.toml @@ -16,12 +16,12 @@ ledger = { path = "../../ledger", package = "mina-tree", features = [ "fuzzing", ] } md5 = "0.7.0" +mina-core = { path = "../../core" } mina-curves = { workspace = true } mina-hasher = { workspace = true } mina-p2p-messages = { workspace = true } mina-signer = { workspace = true } object = "0.37.1" -openmina-core = { path = "../../core" } poseidon = { workspace = true } rand = { version = "0.8.5", features = ["small_rng"] } ring_buffer = "2.0.2" diff --git a/tools/fuzzing/src/main.rs b/tools/fuzzing/src/main.rs index e431e09b32..b903a61517 100644 --- a/tools/fuzzing/src/main.rs +++ b/tools/fuzzing/src/main.rs @@ -23,9 +23,9 @@ pub mod transaction_fuzzer { sparse_ledger::LedgerIntf, Account, BaseLedger, }; + use mina_core::constants::ConstraintConstantsUnversioned; use mina_curves::pasta::Fp; use mina_p2p_messages::bigint::BigInt; - use openmina_core::constants::ConstraintConstantsUnversioned; use std::{ env, io::{Read, Write}, diff --git a/tools/fuzzing/src/transaction_fuzzer/context.rs b/tools/fuzzing/src/transaction_fuzzer/context.rs index 6bffd54118..59dc79e9b5 100644 --- a/tools/fuzzing/src/transaction_fuzzer/context.rs +++ b/tools/fuzzing/src/transaction_fuzzer/context.rs @@ -24,6 +24,7 @@ use ledger::{ transaction_pool::TransactionPool, Account, AccountId, Database, Mask, Timing, TokenId, }; +use mina_core::{consensus::ConsensusConstants, constants::ConstraintConstants, NetworkConfig}; use mina_curves::pasta::{Fp, Fq}; use mina_p2p_messages::{ bigint, binprot, @@ -35,7 +36,6 @@ use mina_p2p_messages::{ }; use mina_signer::{CompressedPubKey, Keypair}; use node::DEVNET_CONFIG; -use openmina_core::{consensus::ConsensusConstants, constants::ConstraintConstants, NetworkConfig}; use rand::{rngs::SmallRng, seq::SliceRandom, Rng, SeedableRng}; use ring_buffer::RingBuffer; use std::{ diff --git a/tools/gossipsub-sandbox/Cargo.toml b/tools/gossipsub-sandbox/Cargo.toml index b4b7ab3b24..c50dd2caa7 100644 --- a/tools/gossipsub-sandbox/Cargo.toml +++ b/tools/gossipsub-sandbox/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "openmina-gossipsub-sandbox" +name = "mina-gossipsub-sandbox" version = "0.16.0" edition = "2021" diff --git a/tools/heartbeats-processor/Cargo.toml b/tools/heartbeats-processor/Cargo.toml index 2b46b00b35..46407e1794 100644 --- a/tools/heartbeats-processor/Cargo.toml +++ b/tools/heartbeats-processor/Cargo.toml @@ -24,5 +24,5 @@ sqlx = { version = "0.8", features = [ ] } tokio = { version = "1.28", features = ["full", "time"] } +mina-core = { path = "../../core" } mina-p2p-messages = { workspace = true } -openmina-core = { path = "../../core" } diff --git a/vrf/Cargo.toml b/vrf/Cargo.toml index 4b3826bcdc..f411b0cc22 100644 --- a/vrf/Cargo.toml +++ b/vrf/Cargo.toml @@ -13,11 +13,11 @@ hex = "0.4.3" ledger = { workspace = true } mina-curves = { workspace = true } mina-hasher = { workspace = true } +mina-node-account = { workspace = true } mina-p2p-messages = { workspace = true } mina-signer = { workspace = true } num = { version = "0.4", features = ["std"] } o1-utils = { workspace = true } -openmina-node-account = { workspace = true } poseidon = { workspace = true } redux = { workspace = true } serde = "1.0.147" diff --git a/vrf/src/lib.rs b/vrf/src/lib.rs index 6b3aba9c20..a598272773 100644 --- a/vrf/src/lib.rs +++ b/vrf/src/lib.rs @@ -2,9 +2,9 @@ use ark_ec::AffineCurve; use ark_ff::PrimeField; use ledger::AccountIndex; use message::VrfMessage; +use mina_node_account::AccountPublicKey; use mina_p2p_messages::v2::EpochSeed; use num::{rational::Ratio, BigInt, ToPrimitive}; -use openmina_node_account::AccountPublicKey; use output::VrfOutput; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -175,11 +175,11 @@ mod test { use ledger::AccountIndex; use num::BigInt; + use mina_node_account::AccountSecretKey; use mina_p2p_messages::{ bigint::BigInt as MinaBigInt, v2::{EpochSeed, MinaBaseEpochSeedStableV1}, }; - use openmina_node_account::AccountSecretKey; use crate::{genesis_vrf, keypair_from_bs58_string, VrfEvaluationInput, VrfEvaluationOutput}; diff --git a/website/docs/developers/getting-started.mdx b/website/docs/developers/getting-started.mdx index 344ccdb7b2..a1f7196b4f 100644 --- a/website/docs/developers/getting-started.mdx +++ b/website/docs/developers/getting-started.mdx @@ -188,7 +188,7 @@ export DATABASE_URL="sqlite:///tmp/heartbeats.db" ```bash # For archive node development -export OPENMINA_ARCHIVE_ADDRESS="http://localhost:3007" +export MINA_ARCHIVE_ADDRESS="http://localhost:3007" export PG_USER="openmina" export PG_PW="openminaopenmina" export PG_DB="openmina_archive" @@ -279,6 +279,107 @@ make build-testing 4. **Read CLAUDE.md**: Check the project-specific development guide in the root directory +## Contributing to Mina + +We welcome contributions from external developers! Whether you're fixing bugs, +adding features, or improving documentation, your contributions help make Mina +better for everyone. + +### Finding Your First Issue + +If you're new to the project and looking for a good place to start, check out +issues labeled as "good first issue": + +**[View First Good Issues →](https://github.com/o1-labs/openmina/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22)** + +These issues are specifically chosen to be: + +- Well-documented with clear requirements +- Self-contained and focused in scope +- Good introductions to the codebase +- Suitable for developers new to the project + +Before starting work on any issue, please comment on it to let others know +you're working on it and to coordinate with the maintainers. + +### Code Quality Standards + +We maintain high code quality standards to ensure the codebase remains +maintainable and consistent. Please follow these guidelines when contributing: + +#### Required Checks Before Submitting + +**1. Formatting and Linting:** + +```bash +# Format all code (Rust, TOML, and markdown files) +make format +make format-md + +# Check formatting is correct +make check-format +make check-md + +# Run linting +make lint +``` + +**2. Remove Trailing Whitespaces:** + +```bash +# Critical: Remove trailing whitespaces (mandatory before every commit) +make fix-trailing-whitespace + +# Verify no trailing whitespaces remain +make check-trailing-whitespace +``` + +**3. Compilation and Testing:** + +```bash +# Ensure code compiles without errors +make check + +# Run the test suite in debug mode +make test + +# Or run the test suite in release mode +make test-release +``` + +**4. Environment Setup for Tests:** + +Some tests require SQLite database setup: + +```bash +# Create SQLite database for heartbeats processor +sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql +export DATABASE_URL="sqlite:///tmp/heartbeats.db" +``` + +#### Pull Request Requirements + +- **All formatting commands must pass** (`make format`, `make format-md`, + `make fix-trailing-whitespace`) +- **Code must compile** (`make check` succeeds) +- **Tests must pass** (at minimum `make test`) +- **No trailing whitespaces** in any files +- **Follow existing code patterns** and conventions in the file you're editing +- **Include clear commit messages** wrapped at 80 characters + +#### Development Workflow + +1. Make your changes following existing code patterns +2. Run formatting: `make format && make format-md` +3. Remove trailing whitespaces: `make fix-trailing-whitespace` +4. Verify compilation: `make check` +5. Run tests: `make test` +6. Commit your changes with a clear message +7. Submit your pull request + +Following these standards helps maintain code consistency and makes the review +process smoother for everyone. + ## Getting Help - **Documentation**: diff --git a/website/docs/node-operators/alpha-testing.md b/website/docs/node-operators/alpha-testing.md index 662849e05c..52b4609f00 100644 --- a/website/docs/node-operators/alpha-testing.md +++ b/website/docs/node-operators/alpha-testing.md @@ -19,6 +19,7 @@ Ensure you have **Docker** installed: ## 2. Download & Start the Node 1. **Download the Latest Release**: + - Visit the [Open Mina Releases](https://github.com/openmina/openmina/releases). - Download the latest `openmina-vX.Y.Z-docker-compose.zip`. @@ -32,16 +33,16 @@ Ensure you have **Docker** installed: Additional optional parameters: - `OPENMINA_LIBP2P_EXTERNAL_IP` Sets your node’s external IP address to help - other nodes find it. + `MINA_LIBP2P_EXTERNAL_IP` Sets your node’s external IP address to help other + nodes find it. - `OPENMINA_LIBP2P_PORT` Sets the port for Libp2p communication. + `MINA_LIBP2P_PORT` Sets the port for Libp2p communication. 3. **Start the Node on Devnet and Save Logs**: Start the node and save the logs for later analysis: ```bash - docker compose up --pull always && docker compose logs > openmina-node.log + docker compose up --pull always && docker compose logs > mina-node.log ``` 4. **Access the Dashboard**: Open `http://localhost:8070` in your browser. @@ -66,7 +67,7 @@ Ensure you have **Docker** installed: If you’ve saved logs to a file, you can use tail or similar tools to view them: ```bash -tail -f openmina-node.log +tail -f mina-node.log ``` ### Restart the Node: diff --git a/website/docs/node-operators/archive-node.md b/website/docs/node-operators/archive-node.md index 9500c42677..5bfd433e16 100644 --- a/website/docs/node-operators/archive-node.md +++ b/website/docs/node-operators/archive-node.md @@ -14,7 +14,7 @@ Stores blocks in a database by receiving them directly from the openmina node **Required Environment Variables**: -- `OPENMINA_ARCHIVE_ADDRESS`: Network address for the archiver service +- `MINA_ARCHIVE_ADDRESS`: Network address for the archiver service ### Local Storage (`--archive-local-storage`) @@ -26,8 +26,8 @@ Stores blocks in the local filesystem **Optional Environment Variables**: -- `OPENMINA_ARCHIVE_LOCAL_STORAGE_PATH`: Custom path for block storage (default: - ~/.openmina/archive-precomputed) +- `MINA_ARCHIVE_LOCAL_STORAGE_PATH`: Custom path for block storage (default: + ~/.mina/archive-precomputed) ### GCP Storage (`--archive-gcp-storage`) @@ -48,7 +48,7 @@ Uploads blocks to an AWS S3 bucket - `AWS_SECRET_ACCESS_KEY`: IAM user secret key - `AWS_DEFAULT_REGION`: AWS region name - `AWS_SESSION_TOKEN`: Temporary session token for temporary credentials -- `OPENMINA_AWS_BUCKET_NAME`: Target S3 bucket name +- `MINA_AWS_BUCKET_NAME`: Target S3 bucket name ## Redundancy diff --git a/website/docs/node-operators/block-producer.md b/website/docs/node-operators/block-producer.md index 0ec9cfd1e8..35cfecb527 100644 --- a/website/docs/node-operators/block-producer.md +++ b/website/docs/node-operators/block-producer.md @@ -22,18 +22,18 @@ Ensure Docker and Docker Compose are installed on your system - ```bash unzip openmina-vX.Y.Z-docker-compose.zip cd openmina-vX.Y.Z-docker-compose - mkdir openmina-workdir + mkdir mina-workdir ``` 2. **Prepare Your Keys** [Docker Compose](https://github.com/o1-labs/openmina/blob/develop/docker-compose.block-producer.yml) - references `openmina-workdir`. It stores a private key and logs for block - production. Place your block producer's private key into the - `openmina-workdir` directory and name it `producer-key`: + references `mina-workdir`. It stores a private key and logs for block + production. Place your block producer's private key into the `mina-workdir` + directory and name it `producer-key`: ```bash - cp /path/to/your/private_key openmina-workdir/producer-key + cp /path/to/your/private_key mina-workdir/producer-key ``` Replace `/path/to/your/private_key` with the actual path to your private key @@ -51,10 +51,10 @@ Ensure Docker and Docker Compose are installed on your system - Optional parameters: - `OPENMINA_LIBP2P_EXTERNAL_IP` Sets your node’s external IP address to help - other nodes find it. + `MINA_LIBP2P_EXTERNAL_IP` Sets your node's external IP address to help other + nodes find it. - `OPENMINA_LIBP2P_PORT` Sets the port for Libp2p communication. + `MINA_LIBP2P_PORT` Sets the port for Libp2p communication. 4. **Go to Dashboard** @@ -85,9 +85,9 @@ using the Makefile target. This method requires building from source. ``` This will create a new key pair and save the private key to - `openmina-workdir/producer-key` and the public key to - `openmina-workdir/producer-key.pub`. The command will fail if keys already - exist to prevent accidental overwriting. + `mina-workdir/producer-key` and the public key to + `mina-workdir/producer-key.pub`. The command will fail if keys already exist + to prevent accidental overwriting. To generate keys with a password: @@ -115,8 +115,8 @@ using the Makefile target. This method requires building from source. **Option B: Use an existing key** ```bash - mkdir -p openmina-workdir - cp /path/to/your/private_key openmina-workdir/producer-key + mkdir -p mina-workdir + cp /path/to/your/private_key mina-workdir/producer-key ``` 2. **Run Block Producer** @@ -140,10 +140,11 @@ using the Makefile target. This method requires building from source. ``` Optional parameters: - - `OPENMINA_LIBP2P_EXTERNAL_IP` - Sets external IP address - - `OPENMINA_LIBP2P_PORT` - Sets libp2p communication port + + - `MINA_LIBP2P_EXTERNAL_IP` - Sets external IP address + - `MINA_LIBP2P_PORT` - Sets libp2p communication port - `PRODUCER_KEY_FILENAME` - Path to producer key (default: - `./openmina-workdir/producer-key`) + `./mina-workdir/producer-key`) Example with all options: @@ -152,8 +153,8 @@ using the Makefile target. This method requires building from source. NETWORK=devnet \ COINBASE_RECEIVER="YourWalletAddress" \ MINA_PRIVKEY_PASS="YourPassword" \ - OPENMINA_LIBP2P_EXTERNAL_IP="1.2.3.4" \ - OPENMINA_LIBP2P_PORT="8302" + MINA_LIBP2P_EXTERNAL_IP="1.2.3.4" \ + MINA_LIBP2P_PORT="8302" ``` 3. **Monitor the Node** @@ -163,11 +164,11 @@ using the Makefile target. This method requires building from source. ### Access Logs -Logs are stored in `openmina-workdir` with filenames like -`openmina.log.2024-10-14`, `openmina.log.2024-10-15`, etc. +Logs are stored in `mina-workdir` with filenames like `mina.log.2024-10-14`, +`mina.log.2024-10-15`, etc. ### Provide Feedback -Collect logs from `openmina-workdir` and report issues on the +Collect logs from `mina-workdir` and report issues on the [rust-node-testing](https://discord.com/channels/484437221055922177/1290662938734231552) discord channel. Include reproduction steps if possible. diff --git a/website/docs/node-operators/local-demo.md b/website/docs/node-operators/local-demo.md index e1459ed5f3..454148b726 100644 --- a/website/docs/node-operators/local-demo.md +++ b/website/docs/node-operators/local-demo.md @@ -6,12 +6,14 @@ operating system, follow these steps: ## Setup Option 1: Download Docker Compose Files from the Release 1. **Download the Docker Compose files:** + - Go to the [Releases page](https://github.com/openmina/openmina/releases) of this repository. - Download the latest `openmina-vX.Y.Z-docker-compose.zip` (or `.tar.gz`) file corresponding to the release version (available since v0.8.0). 2. **Extract the files:** + - Unzip or untar the downloaded file: ```bash unzip openmina-vX.Y.Z-docker-compose.zip