Skip to content

Commit

Permalink
feat: v4 (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtguibas authored Jan 15, 2025
2 parents f1628aa + c6ddc2e commit ba053c3
Show file tree
Hide file tree
Showing 938 changed files with 198,009 additions and 22,662 deletions.
83 changes: 83 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Google C/C++ Code Style settings
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Author: Kehan Xue, kehan.xue (at) gmail.com

Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: Align
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never # To avoid conflict, set this "Never" and each "if statement" should include brace when coding
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterStruct: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 80
CompactNamespaces: false
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false # Make sure the * or & align on the left
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Left
ReflowComments: false
# SeparateDefinitionBlocks: Always # Only support since clang-format 14
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++11
TabWidth: 4
UseTab: Never
7 changes: 5 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
**/target
**/target/**
Dockerfile*
.dockerignore
.git
.gitignore
examples
tests
sp1up
book
target
assets
audits
.github
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-FORM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug report
description: File a bug report
labels: ["T-bug", "T-needs-triage"]
body:
- type: markdown
attributes:
value: |
Please ensure that the bug has not already been filed in the issue tracker.
Thanks for taking the time to report this bug in SP1!
- type: dropdown
attributes:
label: Component
description: What component is the bug in?
multiple: true
options:
- sp1-sdk
- sp1-zkvm
- cargo prove CLI/sp1up
- Other (please describe)
validations:
required: true
- type: checkboxes
attributes:
label: Have you ensured that all of these are up to date?
options:
- label: SP1 SDK
- label: cargo prove CLI/sp1up
- type: input
attributes:
label: What version of SP1 SDK are you on?
description: Leave empty if not relevant
placeholder: "Add the version from the Cargo.toml file here"
- type: input
attributes:
label: What version of the cargo prove CLI are you on?
description: Leave empty if not relevant
placeholder: "Run cargo prove --version and paste the output here"
- type: dropdown
attributes:
label: Operating System
description: What operating system are you on?
options:
- Windows
- macOS (Intel)
- macOS (Apple Silicon)
- Linux (Arch)
- Linux (Debian)
- Linux (Ubuntu)
- Linux (Other)
- type: textarea
attributes:
label: Describe the bug
description: Please include relevant Rust snippets/CLI commands as well if relevant.
validations:
required: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE-FORM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature request
description: Suggest a feature
labels: ["T-feature", "T-needs-triage"]
body:
- type: markdown
attributes:
value: |
Please ensure that the feature has not already been requested in the issue tracker.
Thanks for helping us improve SP1!
- type: dropdown
attributes:
label: Component
description: What component is the feature for?
multiple: true
options:
- sp1-sdk
- sp1-zkvm
- cargo prove CLI/sp1up
- Other (please describe)
validations:
required: true
- type: textarea
attributes:
label: Describe the feature you would like
description: Please also describe what the feature is aiming to solve, if relevant.
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Add any other context to the feature (like screenshots, resources)
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Support
url: https://t.me/+5q4kfeXaBE1hZjEx
about: This issue tracker is only for bugs and feature requests. Support is available on Telegram!
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Bug fixes and new features should include tests.
Typos / punctuation / trivial PRs are generally not accepted.
Contributors guide: https://github.com/succinctlabs/sp1/blob/dev/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and building the
documentation.
-->

<!-- ** Please select "Allow edits from maintainers" in the PR Options ** -->

## Motivation

<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->

## Solution

<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->

## PR Checklist

- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
16 changes: 14 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Note: this is only compatible with Linux runners.

name: Test setup
inputs:
pull_token:
Expand Down Expand Up @@ -75,7 +77,7 @@ runs:
~/.cargo/git/db/
target/
~/.rustup/
key: rust-1.81.0-${{ hashFiles('**/Cargo.toml') }}
key: rust-1.81.0-${{ hashFiles('**/Cargo.toml') }}-x
restore-keys: rust-1.81.0-

- name: Setup toolchain
Expand All @@ -97,6 +99,16 @@ runs:
else
echo "pkg-config and libssl-dev are already installed."
fi
- name: Echo docker buildx version
shell: bash
run: docker buildx version

- name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=public.ecr.aws/vend/moby/buildkit:buildx-stable-1
50 changes: 50 additions & 0 deletions .github/scripts/pkg-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

set -x

# Move into the workspace root
pushd "$(git rev-parse --show-toplevel)" || exit 1

# Initialize error flag
error_occurred=0

# Loop over all the packages in the workspace
while IFS= read -r pkg_json; do
echo "pkg_json: $pkg_json"

# Extract fields
publish=$(echo "$pkg_json" | jq -r '.publish // empty')
manifest_path=$(echo "$pkg_json" | jq -r '.manifest_path')

# Skip if the package is marked as not published
if [ -n "$publish" ]; then
echo "Skipping unpublished package at $manifest_path"
continue
fi

echo "Checking $manifest_path"

# Get the package directory
pkg_dir=$(dirname "$manifest_path")
pushd "$pkg_dir" || exit 1

# Capture the stdin/stdout of `cargo package`
package_output=$(cargo package 2>&1)

# Check if cargo package failed
if [ $? -ne 0 ]; then
echo "Error: Packaging failed"
echo "$package_output"

if echo "$package_output" | grep -iq "cargo.lock"; then
echo "SP1: Only Cargo.lock was modified, this is fine."
else
echo "Error not related to Cargo.lock, marking as failed."
exit 1
fi
fi

popd
done < <(cargo metadata --format-version=1 --no-deps | jq -c '.packages[] | {publish: .publish, manifest_path: .manifest_path}')

popd
Loading

0 comments on commit ba053c3

Please sign in to comment.