Skip to content

Commit

Permalink
chore: devnet to testnet (#291)
Browse files Browse the repository at this point in the history
Includes:
- global input validation and sanitization
- prescribed observer lookup table
- fyeo round 4 issue remediations
- updated monitor tests
- added support for Recipient on balance checks
- additional invariant testing
- allows redelegating to operator stake when below the minimum delegated
stake amount
  • Loading branch information
dtfiedler authored Dec 20, 2024
2 parents 780d12b + 7edaece commit 19f19e8
Show file tree
Hide file tree
Showing 33 changed files with 1,397 additions and 738 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,23 @@ jobs:
- run: yarn test:esm # full e2e integration tests
working-directory: ./ar-io-sdk
env:
IO_PROCESS_ID: ${{ vars.IO_NETWORK_PROCESS_ID }}
ARIO_NETWORK_PROCESS_ID: ${{ vars.ARIO_NETWORK_PROCESS_ID }}
AO_CU_URL: ${{ vars.AO_CU_URL }}

monitor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- run: yarn --frozen-lockfile
- run: yarn monitor
env:
ARIO_NETWORK_PROCESS_ID: ${{ vars.ARIO_NETWORK_PROCESS_ID }}

evolve:
runs-on: ubuntu-latest
needs: [integration, unit, sdk, lint]
Expand All @@ -97,7 +111,7 @@ jobs:
- run: yarn evolve
env:
WALLET: ${{ secrets.WALLET }}
IO_NETWORK_PROCESS_ID: ${{ vars.IO_NETWORK_PROCESS_ID }}
ARIO_NETWORK_PROCESS_ID: ${{ vars.ARIO_NETWORK_PROCESS_ID }}
AO_CU_URL: ${{ vars.AO_CU_URL }}
- name: Notify Success
if: success()
Expand All @@ -120,12 +134,12 @@ jobs:
},
{
"title": "Process ID",
"value": "${{ vars.IO_NETWORK_PROCESS_ID }}",
"value": "${{ vars.ARIO_NETWORK_PROCESS_ID }}",
"short": true
},
{
"title": "View on ao.link",
"value": "https://www.ao.link/#/entity/${{ vars.IO_NETWORK_PROCESS_ID }}?tab=source-code",
"value": "https://www.ao.link/#/entity/${{ vars.ARIO_NETWORK_PROCESS_ID }}?tab=source-code",
"short": false
}
,
Expand All @@ -151,15 +165,15 @@ jobs:
"fallback": "Failed to update IO Process!",
"color": "danger",
"title": "Details",
"text": 'The IO "${{ github.ref_name == 'main' && 'testnet' || 'devnet' }} Process ( ${{ vars.IO_NETWORK_PROCESS_ID }}) FAILED to update!',
"text": 'The IO "${{ github.ref_name == 'main' && 'testnet' || 'devnet' }} Process ( ${{ vars.ARIO_NETWORK_PROCESS_ID }}) FAILED to update!',
"fields": [{
"title": "Network",
"value": "${{ github.ref_name == 'main' && 'testnet' || 'devnet' }}",
"short": true
},
{
"title": "Process ID",
"value": "${{ vars.IO_NETWORK_PROCESS_ID }}",
"value": "${{ vars.ARIO_NETWORK_PROCESS_ID }}",
"short": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: yarn monitor
id: monitor
env:
IO_PROCESS_ID: ${{ matrix.network == 'testnet' && 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA' || 'GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc' }}
ARIO_NETWORK_PROCESS_ID: ${{ matrix.network == 'testnet' && 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA' || 'GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc' }}

- name: Notify Failure
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
"editor.formatOnPaste": true,
"editor.formatOnSaveMode": "file"
},
"cSpell.words": ["hashchain", "redelegate"]
"cSpell.words": ["ARIO", "hashchain", "redelegate"]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"test:unit": "rm -rf coverage && mkdir -p coverage && busted . && luacov",
"test:coverage": "rm -rf luacov-html && yarn test:unit && luacov --reporter html && open luacov-html/index.html",
"monitor": "node --test tests/monitor/monitor.test.mjs",
"monitor:devnet": "IO_PROCESS_ID=GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc node --test tests/monitor/monitor.test.mjs",
"monitor:testnet": "IO_PROCESS_ID=agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA node --test tests/monitor/monitor.test.mjs",
"monitor:devnet": "ARIO_NETWORK_PROCESS_ID=GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc node --test tests/monitor/monitor.test.mjs",
"monitor:testnet": "ARIO_NETWORK_PROCESS_ID=agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA node --test tests/monitor/monitor.test.mjs",
"evolve": "yarn build && node tools/evolve.mjs",
"prepare": "husky"
},
"devDependencies": {
"@ar.io/sdk": "alpha",
"@ar.io/sdk": "^3.1.0-alpha.9",
"@permaweb/ao-loader": "^0.0.36",
"@permaweb/aoconnect": "^0.0.59",
"arweave": "^1.15.1",
Expand Down
29 changes: 29 additions & 0 deletions spec/arns_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,35 @@ describe("arns", function()
assert.is_false(status)
assert.match("Name must be extended before it can be reassigned", error)
end)

it("should not allow reassigning names during the grace period", function()
-- Setup record in grace period
_G.NameRegistry.records["test-name"] = {
endTimestamp = 123456789,
processId = testProcessId,
purchasePrice = 600000000,
startTimestamp = 0,
type = "lease",
undernameLimit = 10,
}

-- Attempt to reassign
local newProcessId = "test-this-is-valid-arweave-wallet-address-2"
local status, error = pcall(
arns.reassignName,
"test-name",
testProcessId,
-- Just before the grace period ends
123456789
+ constants.gracePeriodMs
- 1,
newProcessId
)

-- Assertions
assert.is_false(status)
assert.match("Name must be extended before it can be reassigned", error)
end)
end)
end

Expand Down
Loading

0 comments on commit 19f19e8

Please sign in to comment.