Layr-Labs / Layr-Labs/devkit-cli

Contract Development Workflow Issues and Missing Documentation

Aperta
#217 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Go
Stelle
27
Fork
10
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Summary

While developing custom contracts with DevKit, I've encountered several workflow issues and gaps in documentation that make contract development more difficult than it should be. These issues primarily relate to dependency management, build processes, and the lack of fast feedback loops for contract compilation.

Issues Identified

1. Missing Documentation for Adding Contract Dependencies

Problem: When developers need to install libraries or packages for custom contracts, there's no clear documentation on how to properly add dependencies.

Current Workaround Required:

  • For Forge-based dependencies:
    1. Navigate to .devkit/contracts/ and use forge install <dependency>
    2. Update remappings in .devkit/contracts/foundry.toml if needed
  • For Node.js-based dependencies:
    1. Create a package.json file in .devkit/contracts/
    2. Update remapping in .devkit/contracts/foundry.toml
    3. Manually modify the build command in .devkit/scripts/build to:
      cd .devkit/contracts && npm install && forge clean && forge build -- --include ../../contracts/**/*.sol >&2
      

Impact: This creates a poor developer experience and requires deep knowledge of the DevKit internals.

2. Build and Test Process Doesn't Include Custom Contracts Directory

Problem: Both the build and test targets in .devkit/contracts/Makefile only work with contracts within the .devkit/contracts/ directory and don't include the main ./contracts/ directory where custom contracts are placed.

build:
    forge clean
    forge build

test:
    forge test -vvv

While there is a deploy-custom-contracts target that references custom contracts, the basic build and test commands don't validate that custom contracts compile correctly or run tests for them.

Impact:

  • Developers may write custom contracts in ./contracts/ that have compilation errors, but these errors won't be caught until deployment time
  • Custom contract tests placed in ./contracts/test/ won't be executed by the standard test command
  • No way to run targeted tests for custom contracts during development
3. No Fast Contract Compilation Feedback Loop

Problem: There's no quick way to verify contract compilation without running the full devkit avs build command, which includes many time-consuming steps beyond contract compilation.

Current Limitations:

  • devkit avs build takes significant time due to multiple build steps (binaries, contracts, etc.)
  • Calling the build command in the Makefile directly doesn't build contracts outside the .devkit folder
  • No dedicated contract-only build command for rapid iteration

Impact: Slow feedback loops significantly impact development productivity when iterating on contract code.

Additional Context

These issues became apparent while following the standard DevKit workflow for custom contract development. The current process requires significant manual intervention and deep knowledge of the build system internals, which may deter developers from effectively using DevKit for contract development.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia ispezionando .devkit/contracts/Makefile, .devkit/scripts/build e .devkit/contracts/foundry.toml, quindi confronta i relativi target con la directory ./contracts/ e con il devkit avs build flow. Done deve includere una configurazione documentata delle dipendenze, oltre a un percorso pratico di build e test che copra i custom contracts e fornisca un feedback più rapido durante la compilazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
shell, solidity
Ambito
build-system, developer-experience, documentation, testing
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.