Skip to content

feat: publish the pallet-revive genesis with each release - #253

Open
mordamax wants to merge 6 commits into
masterfrom
feat/pallet-revive-genesis-artifact
Open

feat: publish the pallet-revive genesis with each release#253
mordamax wants to merge 6 commits into
masterfrom
feat/pallet-revive-genesis-artifact

Conversation

@mordamax

@mordamax mordamax commented Aug 26, 2026

Copy link
Copy Markdown

Description

Extends the release artifact with pallet-revive genesis state, so a chain can carry DotNS from block zero instead of deploying it afterwards. build-genesis.sh runs the existing deploy stages against anvil, dumps the EVM state and converts it to a GenesisConfig account list.

paritytech/preview-net-v1 does this today by cloning this repo at a moving master with its own copy of FACTORY_DEPLOYER_KEY. Building it here ties the artifact to the same commit and keys as the ABIs beside it, and lets that repo drop ~790 lines and two secrets.

Follows the pattern #242 set — standalone asset, in the strict pre-publish check, plus a small path-filtered PR workflow (genesis-extractor-test.yml) that tests the extractor, mirroring release-metadata.yml. Addresses are deliberately not re-emitted; deployments.json stays the only copy.

The filename carries the TLD (dotns-genesis-test.json) because DOTNS_TLD is baked into the registry initialiser, so it suits test networks only — the release body says so. Address parity against deployments/paseo-assethub/420420417.json is asserted, so a wrong factory key fails the build.

Type

  • Bug fix
  • Feature
  • Breaking change
  • Documentation
  • Chore
  • Refactor
  • Security

Scope

  • Registration
  • Resolver
  • Store
  • Proof of Personhood
  • Deployment scripts
  • Tests

Related Issues

Follows #242, which made the release carry addresses. This adds genesis state to the same artifact.

Fixes

Checklist

Code

  • Follows project style
  • forge build passes
  • forge test passes
  • No new compiler warnings

Testing

  • New tests added for changed behavior
  • Fuzz tests added where applicable
  • Invariant tests verified

Security

  • No new selfdestruct or delegatecall
  • Access control reviewed
  • No storage layout conflicts (for upgradeable contracts)

Documentation

  • NatSpec updated on changed interfaces
  • README updated if needed

Breaking Changes

  • No breaking changes
  • Breaking changes documented below

How to test

node --test scripts/genesis/extract-genesis.test.mjs   # also runs in CI via genesis-extractor-test.yml
DOTNS_ADMIN_KEY=<key> FACTORY_DEPLOYER_KEY=<key> bash scripts/genesis/build-genesis.sh ./release

Ran locally: five deploy stages, 33 genesis accounts, 19 names matching the live manifest, 9 extractor tests.

Notes

No Solidity changed, so the contract checkboxes are inherited state rather than something this diff exercises.

  1. This deploy overlaps deployall.sh, which also has a factory-exists check and the EXPECTED_CREATE3_FACTORY guard. Driving deploy:all would be DRY-er but needs the keystore flow and the paseo_local alias, which I could not test locally. The constraint if you collapse it is in the script: the signer must stay the admin key, not deploy-contracts.yml's public anvil account.
  2. Unrelated, spotted on the way past: .github/PULL_REQUEST_TEMPLATE.md has a trailing space in its filename, so GitHub never loads it and new PRs open blank. Happy to fix separately.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

CI Summary

Check Result
4naly3er Analysis Found 40 issues: 5 medium, 10 low, 14 gas, 11 informational - View Report
Slither Analysis Found 183 issues: 3 high, 43 medium, 73 low, 64 informational - View Report
Documentation Unknown
Deploy Contracts Reproduces the committed manifest; resume verified
PR Title PR Title Valid
Labels Unknown
Secret Scan Passed - No secrets detected

4naly3er Analysis

Medium (5)

ID Finding Instances
M-1 block.number means different things on different L2s 5
M-2 Centralization Risk for trusted owners 26
M-3 _safeMint() should be used rather than _mint() wherever possible 1
M-4 Using transferFrom on ERC721 tokens 1
M-5 Direct supportsInterface() calls may cause caller to revert 10

Low (10)

ID Finding Instances
L-1 Use a 2-step ownership transfer pattern 3
L-2 External call recipient may consume all transaction gas 10
L-3 Fallback lacking payable 1
L-4 Initializers could be front-run 43
L-5 Signature use at deadlines should be allowed 5
L-6 Use Ownable2Step.transferOwnership instead of `Ownable.transferOwner 1
L-7 Unsafe ERC20 operation(s) 1
L-8 Unsafe solidity low-level call can cause gas grief attack 1
L-9 Upgradeable contract is missing a __gap[50] storage variable to allo 111
L-10 Upgradeable contract not initialized 170

Gas (14)

ID Finding Instances
GAS-1 Use ERC721A instead ERC721 1
GAS-2 Don't use _msgSender() if not supporting EIP-2771 1
GAS-3 a = a + b is more gas effective than a += b for state variables (e 13
GAS-4 Using bools for storage incurs overhead 3
GAS-5 Cache array length outside of loop 5
GAS-6 For Operations that will not overflow, you could use unchecked 342
GAS-7 Use Custom Errors instead of Revert Strings to save Gas 7
GAS-8 Avoid contract existence checks by using low level calls 1
GAS-9 Functions guaranteed to revert when called by normal users can be mark 55
GAS-10 ++i costs less gas compared to i++ or i += 1 (same for --i vs 13
GAS-11 Using private rather than public for constants, saves gas 9
GAS-12 Splitting require() statements that use && saves gas 5
GAS-13 Increments/decrements can be unchecked in for-loops 36
GAS-14 Use != 0 instead of > 0 for unsigned integer comparison 23

Informational (11)

ID Finding Instances
NC-1 constants should be defined rather than using magic numbers 20
NC-2 Control structures do not follow the Solidity Style Guide 110
NC-3 Critical Changes Should Use Two-step Procedure 3
NC-4 Dangerous while(true) loop 1
NC-5 Consider disabling renounceOwnership() 2
NC-6 Functions should not be longer than 50 lines 411
NC-7 Use a modifier instead of a require/if statement for a special `ms 20
NC-8 addresss shouldn't be hard-coded 1
NC-9 Take advantage of Custom Error's return value property 1
NC-10 Avoid the use of sensitive terms 42
NC-11 Variables need not be initialized to zero 13

View full report | View logs

Slither Analysis

High (3)

Check Description Location
arbitrary-send-eth DotnsRegistrarController._settleEscrow(address,uint256,address,bool,uint256) (co contracts/registrars/DotnsRegistrarController.sol:250
arbitrary-send-eth Multicall3.aggregate3Value(Multicall3.Call3Value[]) (contracts/utils/Multicall3. contracts/utils/Multicall3.sol:159
uninitialized-state DotnsNameEscrow._entriesByRecipient (contracts/escrow/DotnsNameEscrow.sol#102) i contracts/escrow/DotnsNameEscrow.sol:102

Medium (43)

Check Description Location
incorrect-equality DotnsRegistrarController.commit(bytes32) (contracts/registrars/DotnsRegistrarCon contracts/registrars/DotnsRegistrarController.sol:139
reentrancy-no-eth Reentrancy in DotnsPopController.reserveBaseName(IDotnsPopController.BaseReserva contracts/registrars/DotnsPopController.sol:212
reentrancy-no-eth Reentrancy in DotnsPopController.reserveBaseNameOnly(IDotnsPopController.BaseNam contracts/registrars/DotnsPopController.sol:235
reentrancy-no-eth Reentrancy in DotnsPopController.registerBaseName(IDotnsPopController.FullRegist contracts/registrars/DotnsPopController.sol:286
reentrancy-no-eth Reentrancy in DotnsPopController.reserveBaseNameOnly(IDotnsPopController.BaseNam contracts/registrars/DotnsPopController.sol:235
reentrancy-no-eth Reentrancy in DotnsPopController._releasePopRulesSlot(bytes32) (contracts/regist contracts/registrars/DotnsPopController.sol:891
reentrancy-no-eth Reentrancy in DotnsPopController.registerBaseName(IDotnsPopController.FullRegist contracts/registrars/DotnsPopController.sol:286
reentrancy-no-eth Reentrancy in DotnsPopController.reserveBaseName(IDotnsPopController.BaseReserva contracts/registrars/DotnsPopController.sol:212
uninitialized-local StringUtils.stripDots(string).outputIndex (contracts/utils/StringUtils.sol#91) i contracts/utils/StringUtils.sol:91
uninitialized-local DotnsPopController.reserveBaseName(IDotnsPopController.BaseReservation).reserved contracts/registrars/DotnsPopController.sol:214
+33 more

Low (73)

Check Description Location
shadowing-local IDotnsPopResolver.setChatKey(bytes32,bytes).chatKey (contracts/resolvers/IDotnsP contracts/resolvers/IDotnsPopResolver.sol:53
shadowing-local IDotnsRegistrarController.isWhiteListed(address).isWhiteListed (contracts/regist contracts/registrars/IDotnsRegistrarController.sol:184
shadowing-local IDotnsPopResolver.chatKey(bytes32).chatKey (contracts/resolvers/IDotnsPopResolve contracts/resolvers/IDotnsPopResolver.sol:71
events-maths DotnsRegistrarController.initialize(IDotnsProtocolRegistry,uint256,uint256) (con contracts/registrars/DotnsRegistrarController.sol:95
missing-zero-check RootGatewayDispatcher.constructor(address).target_ (contracts/registrars/RootGat contracts/registrars/RootGatewayDispatcher.sol:51
calls-loop DotnsPopController._settlePendingLabel(IStoreFactory,address,address,string) (co contracts/registrars/DotnsPopController.sol:433
calls-loop Multicall3.aggregate3(Multicall3.Call3[]) (contracts/utils/Multicall3.sol#128-15 contracts/utils/Multicall3.sol:128
calls-loop DotnsPopLens._countNames(address,bool) (contracts/registrars/DotnsPopLens.sol#12 contracts/registrars/DotnsPopLens.sol:123
calls-loop DotnsPopLens._pageNames(address,uint256,uint256,bool) (contracts/registrars/Dotn contracts/registrars/DotnsPopLens.sol:154
calls-loop Multicall3.tryAggregate(bool,Multicall3.Call[]) (contracts/utils/Multicall3.sol# contracts/utils/Multicall3.sol:67
+63 more

Informational (64)

Check Description Location
assembly LabelUtils.namehashUnder(bytes32,bytes32) (contracts/utils/LabelUtils.sol#52-63) contracts/utils/LabelUtils.sol:52
assembly RootGatewayDispatcher.fallback() (contracts/registrars/RootGatewayDispatcher.sol contracts/registrars/RootGatewayDispatcher.sol:64
assembly LabelUtils.labelhashMemory(string) (contracts/utils/LabelUtils.sol#40-44) uses a contracts/utils/LabelUtils.sol:40
assembly Multicall3.aggregate3Value(Multicall3.Call3Value[]) (contracts/utils/Multicall3. contracts/utils/Multicall3.sol:159
assembly LabelUtils.labelhash(string) (contracts/utils/LabelUtils.sol#25-32) uses assembl contracts/utils/LabelUtils.sol:25
assembly Multicall3.aggregate3(Multicall3.Call3[]) (contracts/utils/Multicall3.sol#128-15 contracts/utils/Multicall3.sol:128
assembly DotnsRegistry._parentNamehash(string) (contracts/registry/DotnsRegistry.sol#217- contracts/registry/DotnsRegistry.sol:217
assembly DotnsPopController._dispatchTyped(bytes4,bytes) (contracts/registrars/DotnsPopCo contracts/registrars/DotnsPopController.sol:923
costly-loop DotnsNameEscrow._removeRefundEntry(uint256,address) (contracts/escrow/DotnsNameE contracts/escrow/DotnsNameEscrow.sol:662
costly-loop DotnsNameEscrow._removeRefundEntry(uint256,address) (contracts/escrow/DotnsNameE contracts/escrow/DotnsNameEscrow.sol:662
+54 more

View full report | View logs

Deploy Contracts

Deployed addresses vs the committed manifest

Expected is the committed manifest; actual is this CI deployment of the same pipeline.

Contract Expected Actual Match
Create3Factory 0x8533c79E058c5a6489CAFeCA86dc600E029D75f5 0x8533c79E058c5a6489CAFeCA86dc600E029D75f5 match
DotnsContentResolver 0x7F74D7CD50f5a834270E2ad395a01b01891AB37d 0x7F74D7CD50f5a834270E2ad395a01b01891AB37d match
DotnsNameEscrow 0x4881Afb78e7C908cAe818168B926229D93376520 0x4881Afb78e7C908cAe818168B926229D93376520 match
DotnsNameWhitelist 0x420166cD67Ca0233094E492a4BbA67045eD7C38C 0x420166cD67Ca0233094E492a4BbA67045eD7C38C match
DotnsPopController 0xCC932348606cc1f3318cADeC5A5Cd2CA447f8a4b 0xCC932348606cc1f3318cADeC5A5Cd2CA447f8a4b match
DotnsPopLens 0xfe5A45f7fD58D1A6FE09455DB799405b1dcE9411 0xfe5A45f7fD58D1A6FE09455DB799405b1dcE9411 match
DotnsPopResolver 0xDaC984884EcA8Fc44011f1D6C49B27828390A72B 0xDaC984884EcA8Fc44011f1D6C49B27828390A72B match
DotnsProtocolRegistry 0xD19e3D0C97CF501125a04A97405e3e6592fa846E 0xD19e3D0C97CF501125a04A97405e3e6592fa846E match
DotnsRegistrar 0x4f06E818Ba3d987704fd91cf3d868E4b019106Ab 0x4f06E818Ba3d987704fd91cf3d868E4b019106Ab match
DotnsRegistrarController 0xBdaA01bD1bA67d709F2b1fF286Da0d854977EA30 0xBdaA01bD1bA67d709F2b1fF286Da0d854977EA30 match
DotnsRegistry 0xf34054fd76BbF85f216cf9908226D5f0A72E50CA 0xf34054fd76BbF85f216cf9908226D5f0A72E50CA match
DotnsResolver 0xbd1165E549DF96F083c0A16f61590927bC187009 0xbd1165E549DF96F083c0A16f61590927bC187009 match
DotnsReverseResolver 0xee3883d7eB60Ee9BCD7F3bcD8f2f05302A9Cc035 0xee3883d7eB60Ee9BCD7F3bcD8f2f05302A9Cc035 match
LabelStoreBeacon 0xb57Ebc2e7085616d4906D1fE49af1cE13f7dffeF 0xb57Ebc2e7085616d4906D1fE49af1cE13f7dffeF match
Multicall3 0xB4468000abD87D3c56cbFBd153161223D7b109e5 0xB4468000abD87D3c56cbFBd153161223D7b109e5 match
PopRules 0x747B456bE03aec0b42bd85C51513730FBD45DA31 0x747B456bE03aec0b42bd85C51513730FBD45DA31 match
RootGatewayDispatcher 0xa889CCA3Fb4B07b98a11cc54C10f13dDA20bc3db 0xa889CCA3Fb4B07b98a11cc54C10f13dDA20bc3db match
StoreFactory 0x709A027F446a9e2a4BB9cb9a9c754435b19e32B7 0x709A027F446a9e2a4BB9cb9a9c754435b19e32B7 match
UserStoreBeacon 0xb7C995601679840d36F37E86DB2d7dF30797eC5C 0xb7C995601679840d36F37E86DB2d7dF30797eC5C match

View full logs

Labels

dependencies, other, type: docs

@github-actions github-actions Bot added the other label Aug 26, 2026
@mordamax mordamax changed the title Publish the pallet-revive genesis with the release feat: publish the pallet-revive genesis with each release Aug 26, 2026
@mordamax
mordamax force-pushed the feat/pallet-revive-genesis-artifact branch 2 times, most recently from aa33d85 to b9ff6cb Compare August 26, 2026 22:49
@sphamjoli

Copy link
Copy Markdown
Member

@mordamax please check PR template please

@mordamax
mordamax force-pushed the feat/pallet-revive-genesis-artifact branch 3 times, most recently from aae3786 to e722db8 Compare August 27, 2026 11:08
@mordamax
mordamax marked this pull request as ready for review August 27, 2026 11:20
@mordamax
mordamax requested a review from re-gius August 27, 2026 11:20
Comment thread scripts/genesis/extract-genesis.mjs Outdated
Comment thread scripts/genesis/build-genesis.sh Outdated
Comment thread scripts/genesis/build-genesis.sh Outdated
Comment thread scripts/genesis/build-genesis.sh Outdated
Comment thread scripts/genesis/extract-genesis.mjs Outdated
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread scripts/genesis/build-genesis.sh Outdated
Comment thread scripts/genesis/extract-genesis.mjs
Comment thread .github/workflows/publish-release.yml Outdated
Comment thread scripts/genesis/extract-genesis.test.mjs Outdated
@mordamax
mordamax force-pushed the feat/pallet-revive-genesis-artifact branch from e722db8 to 6617fdb Compare August 27, 2026 15:53
@mordamax
mordamax force-pushed the feat/pallet-revive-genesis-artifact branch from 6617fdb to 9ebffb8 Compare August 27, 2026 19:48
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Aug 27, 2026
@mordamax

mordamax commented Aug 27, 2026

Copy link
Copy Markdown
Author

all done

also dropped dotns-addresses.json - same data as deployments.json from #242
genesis is in the zip now, and extractor tests run on PRs

one line in foundry.toml: forge 1.8.0 linter aborts on DotnsPopControllerInvariant.t.sol and kills forge build everywhere, on 1.7.1 fine, so looks like upstream bug - left a reason's in the comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file other type: docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants