Skip to content
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b269282
num-bigint: import from https://github.com/openmina/num-bigint/tree/1…
dannywillems Sep 4, 2025
3c3a021
num-bigint: rename in num-bigint-generic
dannywillems Sep 4, 2025
210a00d
num-bigint-generic: add to the workspace
dannywillems Sep 4, 2025
92239f7
num-bigint-generic: run make format
dannywillems Sep 4, 2025
20bf56d
CI: move workflow of num-bigint-generic into global CI
dannywillems Sep 4, 2025
e167e05
Markdown: run make format-md
dannywillems Sep 4, 2025
ea4c00b
num-bigint-generic: make shellcheck happy
dannywillems Sep 4, 2025
9e1b66a
CI: rename template name to num-bigint-generic
dannywillems Sep 4, 2025
846d233
CHANGELOG: add description for patch 1379
dannywillems Sep 4, 2025
51e635a
vendor/num-bigint-generic: fix lint issues
dannywillems Sep 4, 2025
90cbae3
vendor/num-bigint-generic: fix documentation
dannywillems Sep 4, 2025
5470a2a
num-rational: https://github.com/openmina/num-rational/commit/be8f2bf…
dannywillems Sep 4, 2025
ed4551a
Vendor: num-rational into num-rational-generic
dannywillems Sep 4, 2025
0a5eb52
Deps: add num-rational-generic to workspace
dannywillems Sep 4, 2025
f5b9e01
num-rational-generic: run make format
dannywillems Sep 4, 2025
0144da8
num-rational-generic: run make format-md
dannywillems Sep 4, 2025
139d465
num-rational-generic: rename in Cargo.toml
dannywillems Sep 4, 2025
ea026d0
num-rational-generic: make shellcheck happy
dannywillems Sep 4, 2025
9393da4
Vendor/num-rational-generic: update with fork commit
dannywillems Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/num-bigint-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: num-bigint-generic
on: merge_group

jobs:

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [
1.60.0, # MSRV
stable,
beta,
nightly
]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo build
- run: vendor/num-bigint-generic/ci/test_full.sh

# try a target with `BigDigit = u32`
i686:
name: Test (i686)
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable-i686-unknown-linux-gnu
- run: cargo build
- run: vendor/num-bigint-generic/ci/test_full.sh

# try building the x32 target -- x86_64 with target_pointer_width="32"
# (we can't execute without kernel CONFIG_X86_X32_ABI though)
x32:
name: Test (x32)
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-unknown-linux-gnux32
- run: cargo build --target x86_64-unknown-linux-gnux32 --all-features
- run: cargo test --no-run --target x86_64-unknown-linux-gnux32 --all-features

# try a target that doesn't have std at all, but does have alloc
no_std:
name: No Std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- run: cargo build --target thumbv6m-none-eabi --no-default-features --features "serde rand"

fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all --check

doc:
name: Docs.rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc --features std,serde,rand,quickcheck,arbitrary
env:
RUSTDOCFLAGS: --cfg docsrs

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [test, i686, x32, no_std, fmt, doc]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1230](https://github.com/o1-labs/openmina/pull/1230))
- bump itertools from 0.10.5 to 0.12.0 #1228
([#1228](https://github.com/o1-labs/openmina/pull/1228))
- vendor num-bigint#1996d080 and rename it in num-bigint-generic
([#1379](https://github.com/o1-labs/mina-rust/pull/1379/))

### Other

Expand Down
38 changes: 38 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ members = [
"producer-dashboard",

"fuzzer",
"vendor/num-bigint-generic",
"vendor/num-rational-generic",
]

resolver = "2"
Expand Down
28 changes: 28 additions & 0 deletions vendor/num-bigint-generic/.github/workflows/master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: master
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * 0' # 00:00 Sunday

jobs:

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.60.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo build
- run: ./ci/test_full.sh
49 changes: 49 additions & 0 deletions vendor/num-bigint-generic/.github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PR
on:
pull_request:

jobs:

test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.60.0, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: startsWith(matrix.rust, '1')
with:
path: ~/.cargo/registry/index
key: cargo-${{ matrix.rust }}-git-index
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: cargo build
- run: ./ci/test_full.sh

fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all --check

# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [test, fmt]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
4 changes: 4 additions & 0 deletions vendor/num-bigint-generic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Cargo.lock
target
*.bk
*.orig
82 changes: 82 additions & 0 deletions vendor/num-bigint-generic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[package]
authors = ["The Rust Project Developers"]
description = "Big integer implementation for Rust"
documentation = "https://docs.rs/num-bigint"
homepage = "https://github.com/rust-num/num-bigint"
keywords = ["mathematics", "numerics", "bignum"]
categories = ["algorithms", "data-structures", "science"]
license = "MIT OR Apache-2.0"
name = "num-bigint-generic"
repository = "https://github.com/rust-num/num-bigint"
version = "0.4.6"
readme = "README.md"
exclude = ["/ci/*", "/.github/*"]
edition = "2021"
rust-version = "1.60"

[features]
default = ["std"]
std = ["num-integer/std", "num-traits/std"]
arbitrary = ["dep:arbitrary"]
quickcheck = ["dep:quickcheck"]
rand = ["dep:rand"]
serde = ["dep:serde"]
nightly = []

[package.metadata.docs.rs]
features = ["std", "serde", "rand", "quickcheck", "arbitrary"]
rustdoc-args = ["--cfg", "docsrs"]

[[bench]]
name = "bigint"
required-features = ["nightly"]

[[bench]]
name = "factorial"
required-features = ["nightly"]

[[bench]]
name = "gcd"
required-features = ["nightly"]

[[bench]]
name = "roots"
required-features = ["nightly"]

[[bench]]
harness = false
name = "shootout-pidigits"
required-features = ["nightly"]

[dependencies]
tinyvec = { version = "1", features = ["alloc", "rustc_1_55"] }

[dependencies.num-integer]
default-features = false
features = ["i128"]
version = "0.1.46"

[dependencies.num-traits]
default-features = false
features = ["i128"]
version = "0.2.18"

[dependencies.rand]
default-features = false
optional = true
version = "0.8"

[dependencies.serde]
default-features = false
optional = true
version = "1.0"

[dependencies.quickcheck]
default-features = false
optional = true
version = "1"

[dependencies.arbitrary]
default-features = false
optional = true
version = "1"
Loading
Loading