BL-33: On-chain deployment drift check — verify foundry/deployments/<network>.json still matches the chain

Aberta
#244 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@robertocarlous já está trabalhando nisso.

Desde 15/10/2026.

  • #254 de @robertocarlous — aberto

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python, solidity
Domínio
backend, blockchain

Direção de pesquisa

Read foundry/deployments/<network>.json, dincli/cli/system.py around import_deployments, and Developer/BACK_LOG.md BL-33 to understand the deployment records. Then inspect the Foundry scripts and contract interfaces for the listed proxy slots, ownership, wiring, and slasher checks. Done means a read-only verifier reports expected and actual values for each recorded contract and exits non-zero on any drift.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Approved enhancement

Summary

Nothing currently verifies that foundry/deployments/<network>.json (and the din_info that dincli system import-deployments writes) still matches what is actually deployed. A fresh clone, a failed upgrade, or a manual intervention can leave the recorded addresses and the chain out of sync with no visible signal.

Proposal

A read-only check — either a forge script (script/VerifyDeployment.s.sol) or a new dincli system verify-deployment subcommand — that for each contract recorded in the deployments JSON reports OK or DRIFT with expected vs. actual values for:

  1. Proxy implementation slot — read EIP-1967 bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1) and compare against the recorded implementation address.
  2. Proxy admin slot — read EIP-1967 bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1) and compare against the recorded proxyAdmin* address.
  3. Runtime code hash — keccak256(extcode(implementation)) vs. keccak256 of the current forge build artifact's deployedBytecode (immutables masked out via forge inspect --json).
  4. Owner / DIN-Representative addresses — call owner() on each ownable contract and compare.
  5. Wiring — DinCoordinator ↔ DinToken / DinValidatorStake / DinModelRegistry / fee router / treasury links, and slasher authorizations on DinValidatorStake.

Exit non-zero on any DRIFT row.

When to run

  • Before every DevNet 3.0 deploy.
  • After every UpgradePlatform.s.sol run.
  • As an optional CI step on pushes that touch foundry/script/.

Limitations

This check only covers what the deployments JSON records. A clean run does not prove nothing else was deployed or authorized outside that file.

References

  • Developer/BACK_LOG.md BL-33
  • foundry/deployments/ (network JSON files)
  • dincli/cli/system.py import_deployments — the import side that reads the same JSON
  • Terraform state-vs-live drift pattern (Osomudeya/devops-scripting-labs 03-drift-detection, reviewed 2026-10-02)
Linguagem predominante
Python
Estrelas
4
Forks
7
Merge médio
3d 7h
PRs com merge (30d)
33

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de InfiniteZeroFoundation/DevNet

Todas as issues de InfiniteZeroFoundation/DevNet

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.