Skip to content

Conversation

@Savissy
Copy link
Owner

@Savissy Savissy commented Oct 13, 2025

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

github-actions bot and others added 29 commits May 14, 2025 16:27
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: Yura <1009751+Unisay@users.noreply.github.com>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

---------

Co-authored-by: kwxm <2124565+kwxm@users.noreply.github.com>
Co-authored-by: kwxm <kenneth.mackenzie@iohk.io>
Co-authored-by: zeme <lorenzo.calegari@iohk.io>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

---------

Co-authored-by: zeme-wana <15709674+zeme-wana@users.noreply.github.com>
Co-authored-by: zeme <lorenzo.calegari@iohk.io>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: zeme-wana <15709674+zeme-wana@users.noreply.github.com>
Expanded setup instructions related to Nix and Docker, and added the
option to use Demeter.

The new information is based on the Education team's
[plinth-dev-env](https://github.com/iohkedu/plinth-dev-env) development
environment, which was previously used during the PPP and other training
courses and events.

The objective of moving those instructions here is, in part, to be able
to finally fully drop `plinth-dev-env` in favor of `plinth-template` as
the "development environment of choice" for Plinth.

<!--
IMPORTANT: if you are an external contributor, make sure you have read
the "External contributors" section of CONTRIBUTING.

Here are some checklists you may like to use. Use your judgement.

This is just a checklist, all the normative suggestions are covered in
more detail in CONTRIBUTING.
-->
Pre-submit checklist:
- Branch
    - [x] Tests are provided (if possible)
    - [x] Commit sequence broadly makes sense
    - [x] Key commits have useful messages
    - [ ] Changelog fragments have been written (if appropriate)
    - [x] Relevant tickets are mentioned in commit messages
    - [x] Formatting, PNG optimization, etc. are updated
- PR
- [ ] (For external contributions) Corresponding issue exists and is
linked in the description
    - [x] Targeting master unless this is a cherry-pick backport
    - [x] Self-reviewed the diff
    - [x] Useful pull request description
    - [x] Reviewer requested

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

---------

Co-authored-by: Unisay <1009751+Unisay@users.noreply.github.com>
Co-authored-by: Yura Lazarev <Unisay@users.noreply.github.com>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

---------

Co-authored-by: ana-pantilie <45069775+ana-pantilie@users.noreply.github.com>
Co-authored-by: Ana Pantilie <ana.pantilie95@gmail.com>
Co-authored-by: zeme <lorenzo.calegari@iohk.io>
…tersectMBO#57)

This PR adds a comprehensive `.github/copilot-instructions.md` file that
provides GitHub Copilot coding agents with detailed instructions for
working effectively in the plinth-template repository.

## Key Features

**Complete Development Environment Coverage**
- Nix environment setup (recommended approach)
- Docker/Devcontainer configuration  
- Manual installation fallback
- Specific GHC 9.6.x and Cabal 3.8+ requirements

**Build Process Documentation with Timing**
- `cabal update` and `cabal build all` commands with expected durations
- Docker-based build alternatives for network-restricted environments
- Blueprint generation for auction validators and minting policies
- Cache management and troubleshooting steps

**Critical Safety Warnings**
- 7 "NEVER CANCEL" warnings for long-running operations
- Explicit timeout specifications (60-90+ minutes for builds)
- Network dependency documentation (CHaP repository access)
- Plutus-specific build timing expectations

**Manual Validation Scenarios**
- Compilation verification steps
- Blueprint generation with file validation
- Smart contract code integrity checks
- Docker environment validation commands

**Developer Productivity Features**
- Pre-generated repository structure listings
- Common troubleshooting solutions for network, GHC version, and
permission issues
- Linting and formatting tool configuration
- Quick reference sections to minimize exploration commands

The instructions follow an imperative tone ("Run this command", "Set
timeout to X minutes") and provide exhaustive guidance based on actual
testing of the build environment, including validation of Docker
container functionality and measurement of operation timing.

Fixes IntersectMBO#56.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `chap.intersectmbo.org`
> - Triggering command:
`/nix/store/mm852m65blp3r7jq3iqyp8nnc64jw1l4-curl-8.9.1-bin/bin/curl
REDACTED --output /tmp/nix-shell.Cc5EC8/transportAdapterGet16-5
--location --write-out %{http_code} --user-agent cabal-install/3.10.3.0
(linux; x86_64) --silent --show-error --dump-header
/tmp/nix-shell.Cc5EC8/curl-headers16-6.txt` (dns block)
> - Triggering command:
`/nix/store/mm852m65blp3r7jq3iqyp8nnc64jw1l4-curl-8.9.1-bin/bin/curl
REDACTED --output /tmp/nix-shell.ZKI77R/transportAdapterGet15-4
--location --write-out %{http_code} --user-agent cabal-install/3.10.3.0
(linux; x86_64) --silent --show-error --dump-header
/tmp/nix-shell.ZKI77R/curl-headers15-5.txt` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/IntersectMBO/plinth-template/settings/copilot/coding_agent)
(admins only)
>
> </details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/IntersectMBO/plinth-template/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Unisay <1009751+Unisay@users.noreply.github.com>
…ntersectMBO#58)

## Summary

This PR upgrades the validators to use Plutus Core v1.1.0, modernizes
the PlutusLedgerApi imports to use V3, migrates to V3 script signatures,
and includes performance optimizations.

### Changes Made

#### 1. Plutus Core Version Upgrade (v1.0.0 → v1.1.0)
- Updated GHC plugin target version pragma in both validators
- Replaced `plcVersion100` imports with `plcVersion110`
- Updated compiled code generation to use `plcVersion110`

#### 2. PlutusLedgerApi Modernization (V1/V2 → V3)
**AuctionValidator.hs:**
- Migrated core types (`CurrencySymbol`, `Datum`, `Lovelace`,
`OutputDatum`, `POSIXTime`, `PubKeyHash`, `ScriptContext`, `TokenName`,
`TxInfo`, `TxOut`) from V1/V2 to V3
- Updated `getContinuingOutputs` import to V3.Contexts
- Maintained V1 imports for functions not available in V3
(`toPubKeyHash`, `contains`, `lovelaceValueOf`, `valueOf`)

**AuctionMintingPolicy.hs:**
- Migrated `PubKeyHash`, `ScriptContext`, `TxInfo` to V3
- Updated context functions (`ownCurrencySymbol`, `txSignedBy`) to
V3.Contexts
- Added V3 `MintValue` support with `mintValueMinted` for type
compatibility
- Handled V3's `MintValue` type in `txInfoMint` field

#### 3. V3 Script Signature Migration
**AuctionValidator:**
- **New signature**: `AuctionParams -> ScriptContext -> Bool` (was:
`AuctionParams -> AuctionDatum -> AuctionRedeemer -> ScriptContext ->
Bool`)
- Extract `AuctionRedeemer` from `scriptContextRedeemer` using
`getRedeemer`
- Extract `AuctionDatum` from `SpendingScript` scriptInfo
- **Untyped validator**: `BuiltinData -> BuiltinUnit` (was: `BuiltinData
-> BuiltinData -> BuiltinData -> BuiltinUnit`)

**AuctionMintingPolicy:**
- **New signature**: `AuctionMintingParams -> ScriptContext -> Bool`
(was: `AuctionMintingParams -> AuctionMintingRedeemer -> ScriptContext
-> Bool`)
- **Untyped validator**: `BuiltinData -> BuiltinUnit` (was: `BuiltinData
-> BuiltinData -> BuiltinUnit`)

#### 4. Performance Optimizations
- **Script context optimization**: Avoid extracting unused context
attributes (removed unused `scriptRedeemer` extraction in minting
policy)
- **Import consolidation**: Reduced AuctionValidator imports from 5 to 4
PlutusLedgerApi modules, AuctionMintingPolicy from 4 to 3 modules
- **Code cleanup**: Removed unused BLOCK comment markers
(BLOCK1-BLOCK10) and tutorial artifacts
- **Clean imports**: Removed unused `Redeemer` imports after
optimization

#### 5. Import Optimization
- Explored Plutus Ledger API source code to understand re-export
patterns
- Consolidated imports to use fewer, more comprehensive modules
- Leveraged V3's comprehensive re-exports while maintaining specific
imports for utilities

## Technical Improvements

### V3 Migration Benefits
- **Unified signature**: All scripts now use consistent `BuiltinData ->
BuiltinUnit` signature
- **Multi-purpose compatibility**: Same script can be used for different
purposes
- **Modern patterns**: Follows latest Plutus V3 best practices

### Performance Benefits
- **Reduced overhead**: No unnecessary context attribute extraction
- **Cleaner compilation**: Removed unused imports and code
- **Better optimization**: Follows Plutus performance best practices

## Test Results
- ✅ All builds pass successfully
- ✅ Blueprint generation executables compile correctly  
- ✅ No functionality lost in migrations
- ✅ Clean builds without warnings

## Compatibility
- Maintains backward compatibility for all validator logic
- Uses latest Plutus Core and Ledger API features
- Follows modern Plutus development practices
- Ready for Conway era deployment

This comprehensive modernization ensures the validators are using the
latest available APIs, follow current best practices, and are optimally
structured for performance and maintainability.
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: zliu41 <6342538+zliu41@users.noreply.github.com>
Co-authored-by: Ana Pantilie <ana.pantilie95@gmail.com>
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

---------

Co-authored-by: zeme-wana <15709674+zeme-wana@users.noreply.github.com>
Co-authored-by: zeme <lorenzo.calegari@iohk.io>
* Update README.md

* Update Tutorial.md
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.

8 participants