Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
538047d
feat: implement BLE swarm registry system with dual-chain support
aliXsed Feb 6, 2026
06e5a5f
chore: simplify architecture diagram
aliXsed Feb 10, 2026
6d95f61
feat(swarms): require bond on fleet id mints
aliXsed Feb 10, 2026
2b0d4de
feat(swarms): add regional registery feature
aliXsed Feb 12, 2026
f07c7d7
feat(swarms): different shard size for different geo level
aliXsed Feb 12, 2026
9e52897
Consolidate shard reassignment API
aliXsed Feb 12, 2026
55fc8ab
Refactor FleetIdentity to tiers
aliXsed Feb 12, 2026
f16f2c6
Fix FleetIdentity constants: MAX_TIERS=24, BOND_MULTIPLIER=2 (constant)
aliXsed Feb 13, 2026
1ba8514
Rename scanner APIs to EdgeBeaconScanner and highest-bonded terminology
aliXsed Feb 13, 2026
ba6ac56
Implement all-or-nothing tier collection in buildHighestBondedUUIDBundle
aliXsed Feb 16, 2026
f0a658f
Rename variable sc → tierCount for clarity
aliXsed Feb 16, 2026
70391f5
Reorder FleetBurned event parameters for better clarity
aliXsed Feb 16, 2026
024e814
feat(fleet): shared-cursor fair-stop algorithm for buildHighestBonded…
aliXsed Feb 17, 2026
2cc01ce
feat(fleet): add competitive intelligence views (competitiveLandscape…
aliXsed Feb 17, 2026
9664314
refactor(fleet): remove dead error, tierBond bit-shift, extract _addT…
aliXsed Feb 17, 2026
6cff00d
refactor: replace competitive hints with cheapest-inclusion hints
aliXsed Feb 17, 2026
31e1512
refactor: eliminate magic numbers, extract bundle helpers, split _fin…
aliXsed Feb 17, 2026
de71977
remove anyActive
aliXsed Feb 17, 2026
d27c48d
fix lints
aliXsed Feb 18, 2026
e63b9a3
Fix spellcheck typos and dictionary entries
aliXsed Feb 18, 2026
534cfc7
Simplify CI: remove zksync flag, fix lint warnings
aliXsed Feb 18, 2026
5a19bd4
Add edge case tests for _findCheapestInclusionTier
aliXsed Feb 18, 2026
4f2ef7d
feat(FleetIdentity): implement partial tier inclusion for bundle buil…
aliXsed Feb 18, 2026
f58f57c
refactor(FleetIdentity): remove redundant discovery functions
aliXsed Feb 18, 2026
22fa52a
add more test
aliXsed Feb 18, 2026
662394a
refactor(FleetIdentity): remove global level, 2-level system (Country…
aliXsed Feb 19, 2026
00c8a8b
remove public caller for tier cap
aliXsed Feb 19, 2026
45e6afb
remove public caller for tier cap
aliXsed Feb 19, 2026
07dedc1
register same uuid for different regions
aliXsed Feb 19, 2026
050564a
feat(FleetIdentity): enforce UUID ownership across multi-region regis…
aliXsed Feb 19, 2026
90b7d7c
feat(FleetIdentity): add level enforcement and migrateRegion()
aliXsed Feb 19, 2026
cf6faa0
correct the license
aliXsed Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions --data
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"jsonrpc":"2.0","error":{"code":-32700,"message":"parse error"},"id":null}
1 change: 1 addition & 0 deletions --header
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"jsonrpc":"2.0","error":{"code":-32700,"message":"parse error"},"id":null}
1 change: 1 addition & 0 deletions --url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"jsonrpc":"2.0","error":{"code":-32700,"message":"parse error"},"id":null}
33 changes: 33 additions & 0 deletions .agent/rules/solidity_zksync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Solidity & ZkSync Development Standards

## Toolchain & Environment
- **Primary Tool**: `forge` (ZkSync fork). Use for compilation, testing, and generic scripting.
- **Secondary Tool**: `hardhat`. Use only when `forge` encounters compatibility issues (e.g., complex deployments, specific plugin needs).
- **Network Target**: ZkSync Era (Layer 2).
- **Solidity Version**: `^0.8.20` (or `0.8.24` if strictly supported by the zk-compiler).

## Modern Solidity Best Practices
- **Safety First**:
- **Checks-Effects-Interactions (CEI)** pattern must be strictly followed.
- When a contract requires an owner (e.g., admin-configurable parameters), prefer `Ownable2Step` over `Ownable`. Do **not** add ownership to contracts that don't need it — many contracts are fully permissionless by design.
- Prefer `ReentrancyGuard` for external calls where appropriate.
- **Gas & Efficiency**:
- Use **Custom Errors** (`error MyError();`) instead of `require` strings.
- Use `mapping` over arrays for membership checks where possible.
- Minimize on-chain storage; use events for off-chain indexing.

## Testing Standards
- **Framework**: Foundry (Forge).
- **Methodology**:
- **Unit Tests**: Comprehensive coverage for all functions.
- **Fuzz Testing**: Required for arithmetic and purely functional logic.
- **Invariant Testing**: Define invariants for stateful system properties.
- **Naming Convention**:
- `test_Description`
- `testFuzz_Description`
- `test_RevertIf_Condition`

## ZkSync Specifics
- **System Contracts**: Be aware of ZkSync system contracts (e.g., `ContractDeployer`, `L2EthToken`) when interacting with low-level features.
- **Gas Model**: Account for ZkSync's different gas metering if performing low-level optimization.
- **Compiler Differences**: Be mindful of differences between `solc` and `zksolc` (e.g., `create2` address derivation).
17 changes: 16 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
"Frontends",
"testuser",
"testhandle",
"douglasacost"
"douglasacost",
"IBEACON",
"AABBCCDD",
"SSTORE",
"Permissionless",
"Reentrancy",
"SFID",
"EXTCODECOPY",
"solady",
"SLOAD",
"Bitmask",
"mstore",
"MBOND",
"USCA",
"USNY",
"usca"
]
}
33 changes: 33 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Solidity & ZkSync Development Standards

## Toolchain & Environment
- **Primary Tool**: `forge` (ZkSync fork). Use for compilation, testing, and generic scripting.
- **Secondary Tool**: `hardhat`. Use only when `forge` encounters compatibility issues (e.g., complex deployments, specific plugin needs).
- **Network Target**: ZkSync Era (Layer 2).
- **Solidity Version**: `^0.8.20` (or `0.8.24` if strictly supported by the zk-compiler).

## Modern Solidity Best Practices
- **Safety First**:
- **Checks-Effects-Interactions (CEI)** pattern must be strictly followed.
- Use `Ownable2Step` over `Ownable` for privileged access.
- Prefer `ReentrancyGuard` for external calls where appropriate.
- **Gas & Efficiency**:
- Use **Custom Errors** (`error MyError();`) instead of `require` strings.
- Use `mapping` over arrays for membership checks where possible.
- Minimize on-chain storage; use events for off-chain indexing.

## Testing Standards
- **Framework**: Foundry (Forge).
- **Methodology**:
- **Unit Tests**: Comprehensive coverage for all functions.
- **Fuzz Testing**: Required for arithmetic and purely functional logic.
- **Invariant Testing**: Define invariants for stateful system properties.
- **Naming Convention**:
- `test_Description`
- `testFuzz_Description`
- `test_RevertIf_Condition`

## ZkSync Specifics
- **System Contracts**: Be aware of ZkSync system contracts (e.g., `ContractDeployer`, `L2EthToken`) when interacting with low-level features.
- **Gas Model**: Account for ZkSync's different gas metering if performing low-level optimization.
- **Compiler Differences**: Be mindful of differences between `solc` and `zksolc` (e.g., `create2` address derivation).
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
run: yarn lint

- name: Run tests
run: forge test --zksync
run: forge test
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "lib/era-contracts"]
path = lib/era-contracts
url = https://github.com/matter-labs/era-contracts
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"editor.formatOnSave": true,
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity"
},
"chat.tools.terminal.autoApprove": {
"forge": true
}
}
20 changes: 20 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"lib/zksync-storage-proofs": {
"rev": "4b20401ce44c1ec966a29d893694f65db885304b"
},
"lib/openzeppelin-contracts": {
"rev": "e4f70216d759d8e6a64144a9e1f7bbeed78e7079"
},
"lib/solady": {
"tag": {
"name": "v0.1.26",
"rev": "acd959aa4bd04720d640bf4e6a5c71037510cc4b"
}
},
"lib/forge-std": {
"rev": "1eea5bae12ae557d589f9f0f0edae2faa47cb262"
},
"lib/era-contracts": {
"rev": "84d5e3716f645909e8144c7d50af9dd6dd9ded62"
}
}
1 change: 1 addition & 0 deletions lib/solady
Submodule solady added at acd959
32 changes: 32 additions & 0 deletions logs/deploy_l1_bridge.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Compiling 1 files with Solc 0.8.26
Solc 0.8.26 finished in 2.60s
Compiler run successful!
Script ran successfully.

== Logs ==
Deployed L1Bridge at 0x2D02b651Ea9630351719c8c55210e042e940d69a
Granted MINTER_ROLE on NodlL1(0x6dd0E17ec6fE56c5f58a0Fe2Bb813B9b5cc25990) to bridge

## Setting up 1 EVM.

==========================

Chain 1

Estimated gas price: 0.222068762 gwei

Estimated total gas used for script: 2685066

Estimated amount required: 0.000596269282508292 ETH

==========================


==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.

Transactions saved to: /Users/alex/Documents/rollup/broadcast/DeployL1Bridge.s.sol/1/run-latest.json

Sensitive values saved to: /Users/alex/Documents/rollup/cache/DeployL1Bridge.s.sol/1/run-latest.json

29 changes: 29 additions & 0 deletions logs/deploy_l1_nodl.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
No files changed, compilation skipped
Script ran successfully.

== Logs ==
Deployed L1Nodl at 0x6dd0E17ec6fE56c5f58a0Fe2Bb813B9b5cc25990

## Setting up 1 EVM.

==========================

Chain 1

Estimated gas price: 0.251645298 gwei

Estimated total gas used for script: 4998146

Estimated amount required: 0.001257759939617508 ETH

==========================


==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.

Transactions saved to: /Users/alex/Documents/rollup/broadcast/DeployL1Nodl.s.sol/1/run-latest.json

Sensitive values saved to: /Users/alex/Documents/rollup/cache/DeployL1Nodl.s.sol/1/run-latest.json

98 changes: 98 additions & 0 deletions logs/deploy_l2_bridge.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Compiling 1 files with Solc 0.8.26
Solc 0.8.26 finished in 1.70s
Compiler run successful!

Compiling 1 files with zksolc and solc 0.8.26
zksolc and solc 0.8.26 finished in 4.05s
Compiler run successful with warnings:
Warning
ZKsync Era comes with native account abstraction support, and therefore the initiator of a
transaction might be different from the contract calling your code. It is highly recommended NOT
to rely on tx.origin, but use msg.sender instead.
Learn more about Account Abstraction at https://docs.zksync.io/build/developer-reference/account-abstraction/
You may disable this warning with:
a. `suppressedWarnings = ["txorigin"]` in standard JSON.
b. `--suppress-warnings txorigin` in the CLI.
--> lib/era-contracts/l1-contracts/contracts/vendor/AddressAliasHelper.sol:56:42 |
56 | _recipient = _prevMsgSender == tx.origin
| ^^^^^^^^^

Warning
EraVM does not use bytecode for contract deployment. Instead, it refers to contracts using their bytecode hashes.
In order to deploy a contract, please use the `new` operator in Solidity instead of raw 'create'/'create2' in assembly.
In Solidity v0.6 and older, it can be a false-positive warning if there is 'create(' or 'create2(' in comments within assembly.
Learn more about CREATE/CREATE2 EraVM limitations at https://docs.zksync.io/zksync-protocol/differences/evm-instructions#create-create2
You may disable this warning with:
1. `suppressedWarnings = ["assemblycreate"]` in standard JSON.
2. `--suppress-warnings assemblycreate` in the CLI.
--> lib/forge-std/src/StdCheats.sol:494:19 |
494 | addr := create(0, add(bytecode, 0x20), mload(bytecode))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning
EraVM does not use bytecode for contract deployment. Instead, it refers to contracts using their bytecode hashes.
In order to deploy a contract, please use the `new` operator in Solidity instead of raw 'create'/'create2' in assembly.
In Solidity v0.6 and older, it can be a false-positive warning if there is 'create(' or 'create2(' in comments within assembly.
Learn more about CREATE/CREATE2 EraVM limitations at https://docs.zksync.io/zksync-protocol/differences/evm-instructions#create-create2
You may disable this warning with:
1. `suppressedWarnings = ["assemblycreate"]` in standard JSON.
2. `--suppress-warnings assemblycreate` in the CLI.
--> lib/forge-std/src/StdCheats.sol:504:19 |
504 | addr := create(0, add(bytecode, 0x20), mload(bytecode))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning
EraVM does not use bytecode for contract deployment. Instead, it refers to contracts using their bytecode hashes.
In order to deploy a contract, please use the `new` operator in Solidity instead of raw 'create'/'create2' in assembly.
In Solidity v0.6 and older, it can be a false-positive warning if there is 'create(' or 'create2(' in comments within assembly.
Learn more about CREATE/CREATE2 EraVM limitations at https://docs.zksync.io/zksync-protocol/differences/evm-instructions#create-create2
You may disable this warning with:
1. `suppressedWarnings = ["assemblycreate"]` in standard JSON.
2. `--suppress-warnings assemblycreate` in the CLI.
--> lib/forge-std/src/StdCheats.sol:515:19 |
515 | addr := create(val, add(bytecode, 0x20), mload(bytecode))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning
EraVM does not use bytecode for contract deployment. Instead, it refers to contracts using their bytecode hashes.
In order to deploy a contract, please use the `new` operator in Solidity instead of raw 'create'/'create2' in assembly.
In Solidity v0.6 and older, it can be a false-positive warning if there is 'create(' or 'create2(' in comments within assembly.
Learn more about CREATE/CREATE2 EraVM limitations at https://docs.zksync.io/zksync-protocol/differences/evm-instructions#create-create2
You may disable this warning with:
1. `suppressedWarnings = ["assemblycreate"]` in standard JSON.
2. `--suppress-warnings assemblycreate` in the CLI.
--> lib/forge-std/src/StdCheats.sol:525:19 |
525 | addr := create(val, add(bytecode, 0x20), mload(bytecode))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2025-10-15T00:35:52.095529Z ERROR backendhandler: failed to get block err=failed to get block; error sending request for url (https://mainnet.era.zksync.io/); operation timed out number=65260273
2025-10-15T00:35:52.096034Z ERROR sharedbackend: Failed to send/recv `block_hash` err=failed to get block hash for 65260273: failed to get block; error sending request for url (https://mainnet.era.zksync.io/); operation timed out number=65260273
Script ran successfully.

== Logs ==
Deployed L2Bridge at 0x2c1B65dA72d5Cf19b41dE6eDcCFB7DD83d1B529E
Granted MINTER_ROLE on NODL(0xBD4372e44c5eE654dd838304006E1f0f69983154) to bridge

## Setting up 1 EVM.

==========================

Chain 324

Estimated gas price: 0.090500001 gwei

Estimated total gas used for script: 209410861

Estimated amount required: 0.018951683129910861 ETH

==========================


==========================

ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.

Transactions saved to: /Users/alex/Documents/rollup/broadcast/DeployL2Bridge.s.sol/324/run-latest.json

Sensitive values saved to: /Users/alex/Documents/rollup/cache/DeployL2Bridge.s.sol/324/run-latest.json

Expand Down
3 changes: 2 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@openzeppelin=lib/openzeppelin-contracts/
@openzeppelin=lib/openzeppelin-contracts/
solady/=lib/solady/src/
Loading