Skip to content

Fix/docs#151

Merged
quantumshiro merged 21 commits into
developfrom
fix/docs
Jul 28, 2025
Merged

Fix/docs#151
quantumshiro merged 21 commits into
developfrom
fix/docs

Conversation

@quantumshiro
Copy link
Copy Markdown
Member

Closes #

📋 Description

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes, no api changes)
  • ⚡ Performance improvements
  • 🧪 Test additions or updates
  • 🎨 UI/UX improvements

🧪 Testing

  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • Integration tests pass locally with my changes
  • I have run make pre-commit and all checks pass

📸 Screenshots (if applicable)

📝 Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

🔗 Related Issues

📋 Additional Notes

Is this a breaking change (Yes/No):

Additional Information

- Added the PolyTorusUtxoExecutionLayer struct for managing eUTXO transactions, including script execution, UTXO set management, and transaction processing.
- Introduced UtxoExecutionConfig for configurable execution parameters.
- Implemented methods for executing single transactions and batches, validating scripts, and managing UTXO states.
- Created a comprehensive demo in utxo_demo.rs to showcase UTXO creation, transaction execution, block mining, and consensus validation.
- Included tests for the execution layer to ensure functionality and correctness.
- Refactor UTXO execution and consensus layer imports in utxo_demo.rs
- Add eUTXO consensus layer implementation in consensus_engine.rs
  - Includes block validation, mining, and slot-based timing
  - Implements UtxoConsensusLayer trait
- Add eUTXO execution layer implementation in execution_engine.rs
  - Supports UTXO transaction processing, script execution, and UTXO set management
  - Implements UtxoExecutionLayer trait
- Introduce configuration structs for both layers with sensible defaults
- Implement unit tests for both consensus and execution layers to ensure functionality
… and HD wallet support

- Added Address struct with various formats (Hex, Base58, Bech32, Blake3) and encoding methods.
- Implemented encoding and decoding functions for hexadecimal and Base58 formats.
- Created comprehensive error handling using WalletError enum for various wallet operations.
- Developed HD wallet structure with mnemonic generation and key derivation methods.
- Introduced KeyPair management for Ed25519 and secp256k1 cryptographic schemes.
- Implemented Signature struct with verification utilities for Ed25519 and secp256k1 signatures.
- Created Wallet and WalletManager for managing multiple wallets and signing operations.
- Added unit tests for all major functionalities to ensure correctness and reliability.
Comment thread .github/workflows/build.yml Fixed
Comment thread .github/workflows/build.yml Fixed
Comment thread .github/workflows/ci.yml
Comment on lines +14 to +43
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run tests
run: cargo test --verbose

- name: Run layer tests
run: |
cargo test -p execution --verbose
cargo test -p settlement --verbose
cargo test -p consensus --verbose
cargo test -p data-availability --verbose

lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml
Comment on lines +14 to +43
name: Auto Format
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run cargo fmt
run: cargo fmt

- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
if git diff --staged --quiet; then
echo "No formatting changes needed"
else
git commit -m "Auto-format code with cargo fmt"
git push
fi

test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 10 months ago

To fix the problem, we should explicitly set the permissions key in the workflow. The best approach is to set the default permissions at the workflow level to the most restrictive (contents: read), and then override them at the job level where more permissions are needed. In this case, the format job needs to push changes, so it requires contents: write, while the test and lint jobs only need contents: read.

Steps:

  1. Add a permissions: contents: read block at the top level of the workflow (after name: and before on:).
  2. Add a permissions: contents: write block to the format job.
  3. No changes are needed for the test and lint jobs, as they will inherit the default contents: read permission.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,2 +1,4 @@
 name: CI
+permissions:
+  contents: read
 
@@ -16,2 +18,4 @@
     if: github.event_name == 'pull_request'
+    permissions:
+      contents: write
     steps:
EOF
@@ -1,2 +1,4 @@
name: CI
permissions:
contents: read

@@ -16,2 +18,4 @@
if: github.event_name == 'pull_request'
permissions:
contents: write
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment thread .github/workflows/ci.yml Fixed
Comment on lines +13 to +47
name: Build Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}

- name: Build release
run: cargo build --release --target x86_64-unknown-linux-gnu

- name: Package binary
run: |
cd target/x86_64-unknown-linux-gnu/release
tar czf ../../../polytorus-linux-amd64.tar.gz polytorus

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: polytorus-linux-amd64
path: polytorus-linux-amd64.tar.gz

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 10 months ago

To fix the problem, explicitly set the permissions key in the workflow file to restrict the GITHUB_TOKEN to the minimum required privileges. Since this workflow only checks out code, builds, and uploads artifacts (and does not push code, create releases, or interact with issues or pull requests), it only needs read access to repository contents. The best way to fix this is to add permissions: contents: read at the top level of the workflow (just after the name: line and before on:), so it applies to all jobs in the workflow. No other changes are needed.


Suggested changeset 1
.github/workflows/build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,2 +1,4 @@
 name: Build
+permissions:
+  contents: read
 
EOF
@@ -1,2 +1,4 @@
name: Build
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Comment thread .github/workflows/ci.yml
Comment on lines +70 to +81
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Run clippy
run: cargo clippy No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 10 months ago

To fix the issue, we need to add a permissions block to the lint job to explicitly limit the permissions of the GITHUB_TOKEN. Since the lint job only runs cargo clippy and does not require write access, the permissions can be set to contents: read. This ensures that the job has the minimum required permissions and adheres to security best practices.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,2 +71,4 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     steps:
EOF
@@ -71,2 +71,4 @@
runs-on: ubuntu-latest
permissions:
contents: read
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
- Fix is_multiple_of() method calls by removing unnecessary references
- Use contract name parameter in deploy_contract() for better logging and identification
- Include contract name in init_params for deployed contracts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@quantumshiro quantumshiro merged commit 0a495a1 into develop Jul 28, 2025
5 of 6 checks passed
@quantumshiro quantumshiro deleted the fix/docs branch July 28, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants