diff --git a/AllTests-mainnet.md b/AllTests-mainnet.md index dd7e66b5e..614c86958 100644 --- a/AllTests-mainnet.md +++ b/AllTests-mainnet.md @@ -110,12 +110,12 @@ OK: 2/2 Fail: 0/2 Skip: 0/2 OK: 2/2 Fail: 0/2 Skip: 0/2 ## DeleteKeys requests [Preset: mainnet] ```diff -+ Deleting not existing key [Preset: mainnet] OK -+ Invalid Authorization Header [Preset: mainnet] OK -+ Invalid Authorization Token [Preset: mainnet] OK -+ Missing Authorization header [Preset: mainnet] OK +- Deleting not existing key [Preset: mainnet] Fail +- Invalid Authorization Header [Preset: mainnet] Fail +- Invalid Authorization Token [Preset: mainnet] Fail +- Missing Authorization header [Preset: mainnet] Fail ``` -OK: 4/4 Fail: 0/4 Skip: 0/4 +OK: 0/4 Fail: 4/4 Skip: 0/4 ## DeleteRemoteKeys requests [Preset: mainnet] ```diff + Deleting existing local key and remote key [Preset: mainnet] OK @@ -224,12 +224,12 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 OK: 4/4 Fail: 0/4 Skip: 0/4 ## ImportKeystores requests [Preset: mainnet] ```diff -+ ImportKeystores/ListKeystores/DeleteKeystores [Preset: mainnet] OK +- ImportKeystores/ListKeystores/DeleteKeystores [Preset: mainnet] Fail + Invalid Authorization Header [Preset: mainnet] OK + Invalid Authorization Token [Preset: mainnet] OK -+ Missing Authorization header [Preset: mainnet] OK +- Missing Authorization header [Preset: mainnet] Fail ``` -OK: 4/4 Fail: 0/4 Skip: 0/4 +OK: 2/4 Fail: 2/4 Skip: 0/4 ## ImportRemoteKeys/ListRemoteKeys/DeleteRemoteKeys [Preset: mainnet] ```diff + Importing list of remote keys [Preset: mainnet] OK @@ -339,6 +339,11 @@ OK: 12/12 Fail: 0/12 Skip: 0/12 + vesion 2 single remote OK ``` OK: 3/3 Fail: 0/3 Skip: 0/3 +## Serialization/deserialization [Preset: mainnet] +```diff ++ Deserialization test vectors OK +``` +OK: 1/1 Fail: 0/1 Skip: 0/1 ## Slashing Interchange tests [Preset: mainnet] ```diff + Slashing test: duplicate_pubkey_not_slashable.json OK @@ -568,4 +573,4 @@ OK: 1/1 Fail: 0/1 Skip: 0/1 OK: 9/9 Fail: 0/9 Skip: 0/9 ---TOTAL--- -OK: 317/322 Fail: 0/322 Skip: 5/322 +OK: 312/323 Fail: 6/323 Skip: 5/323 diff --git a/Jenkinsfile b/Jenkinsfile index 6490e1bee..43909261d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,12 +43,7 @@ def runStages(nodeDir) { } } stage("REST test suite") { timeout(5) { - sh """#!/bin/bash - set -e - ./tests/simulation/restapi.sh --data-dir resttest0_data --base-port \$(( 9100 + EXECUTOR_NUMBER * 100 )) \ - --base-rest-port \$(( 7100 + EXECUTOR_NUMBER * 100 )) --base-metrics-port \ - \$(( 8108 + EXECUTOR_NUMBER * 100 )) --resttest-delay 30 --kill-old-processes - """ + sh "make restapi-test" } } stage("Testnet finalization") { timeout(75) { diff --git a/Makefile b/Makefile index 916112661..b8a335b2b 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ NODE_ID := 0 BASE_PORT := 9000 BASE_REST_PORT := 5052 BASE_METRICS_PORT := 8008 +EXECUTOR_NUMBER := 0 ROPSTEN_WEB3_URL := "--web3-url=wss://ropsten.infura.io/ws/v3/809a18497dd74102b5f37d25aae3c85a" SEPOLIA_WEB3_URL := "--web3-url=https://rpc.sepolia.dev --web3-url=https://www.sepoliarpc.space" @@ -147,6 +148,15 @@ update: | update-common libbacktrace: + "$(MAKE)" -C vendor/nim-libbacktrace --no-print-directory BUILD_CXX_LIB=0 +restapi-test: + ./tests/simulation/restapi.sh \ + --data-dir resttest0_data \ + --base-port $$(( 9100 + EXECUTOR_NUMBER * 100 )) \ + --base-rest-port $$(( 7100 + EXECUTOR_NUMBER * 100 )) \ + --base-metrics-port $$(( 8108 + EXECUTOR_NUMBER * 100 )) \ + --resttest-delay 30 \ + --kill-old-processes + # test binaries that can output an XML report XML_TEST_BINARIES := \ consensus_spec_tests_mainnet \ diff --git a/beacon_chain/rpc/rest_key_management_api.nim b/beacon_chain/rpc/rest_key_management_api.nim index 490b7bd28..5b37d825b 100644 --- a/beacon_chain/rpc/rest_key_management_api.nim +++ b/beacon_chain/rpc/rest_key_management_api.nim @@ -165,7 +165,7 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) = return RestApiResponse.jsonResponsePlain(response) # https://ethereum.github.io/keymanager-APIs/#/Keymanager/DeleteKeys - router.api(MethodPost, "/api/eth/v1/keystores/delete") do ( + router.api(MethodDelete, "/api/eth/v1/keystores") do ( contentBody: Option[ContentBody]) -> RestApiResponse: let authStatus = checkAuthorization(request, node) if authStatus.isErr(): @@ -369,9 +369,9 @@ proc installKeymanagerHandlers*(router: var RestRouter, node: BeaconNode) = "/api/eth/v1/keystores") router.redirect( - MethodPost, - "/eth/v1/keystores/delete", - "/api/eth/v1/keystores/delete") + MethodDelete, + "/eth/v1/keystores", + "/api/eth/v1/keystores") router.redirect( MethodGet, diff --git a/beacon_chain/spec/eth2_apis/rest_keymanager_calls.nim b/beacon_chain/spec/eth2_apis/rest_keymanager_calls.nim index 09de12b89..41da21940 100644 --- a/beacon_chain/spec/eth2_apis/rest_keymanager_calls.nim +++ b/beacon_chain/spec/eth2_apis/rest_keymanager_calls.nim @@ -32,8 +32,8 @@ proc importKeystoresPlain*(body: KeystoresAndSlashingProtection ## https://ethereum.github.io/keymanager-APIs/#/Keymanager/ImportKeystores proc deleteKeysPlain*(body: DeleteKeystoresBody): RestPlainResponse {. - rest, endpoint: "/eth/v1/keystores/delete", - meth: MethodPost.} + rest, endpoint: "/eth/v1/keystores", + meth: MethodDelete.} ## https://ethereum.github.io/keymanager-APIs/#/Keymanager/DeleteKeys proc listKeys*(client: RestClientRef, diff --git a/ncli/resttest-rules.json b/ncli/resttest-rules.json index 138bf17dc..d3ed64af9 100644 --- a/ncli/resttest-rules.json +++ b/ncli/resttest-rules.json @@ -3338,8 +3338,8 @@ { "topics": ["key_management", "delete_keys"], "request": { - "url": "/eth/v1/keystores/delete", - "method": "POST", + "url": "/eth/v1/keystores", + "method": "DELETE", "headers": {"Accept": "application/json", "Authorization": "Bearer testToken"}, "body": {"content-type": "application/json", "data": "{\"pubkeys\":[\"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001\"]}" }