Skip to content

Commit bdccc7a

Browse files
authored
test: add lotus-gateway parity test (#6570)
1 parent 871a4e0 commit bdccc7a

File tree

3 files changed

+160
-1
lines changed

3 files changed

+160
-1
lines changed

scripts/tests/api_compare/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
55
LOTUS_RPC_PORT=1234
66
FOREST_RPC_PORT=2345
77
FOREST_OFFLINE_RPC_PORT=3456
8+
FOREST_VIA_GATEWAY_RPC_PORT=4567
89
FOREST_HEALTHZ_RPC_PORT=2346
910
CHAIN=calibnet
1011

scripts/tests/api_compare/docker-compose.yml

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,29 @@ services:
140140
timeout: 3s
141141
retries: 3
142142
start_period: 10m
143+
forest-via-gateway:
144+
depends_on:
145+
forest-rpc-ready:
146+
condition: service_completed_successfully
147+
image: ${LOTUS_IMAGE}
148+
volumes:
149+
- node-data:/data
150+
networks:
151+
- api-tests
152+
entrypoint: ["/bin/bash", "-c"]
153+
command:
154+
- |
155+
set -euxo pipefail
156+
export FULLNODE_API_INFO="$(cat /data/forest-token):/dns/forest/tcp/${FOREST_RPC_PORT}/http"
157+
lotus-gateway run --api-max-lookback 72000h --listen 0.0.0.0:${FOREST_VIA_GATEWAY_RPC_PORT}
158+
healthcheck:
159+
test: |
160+
export FULLNODE_API_INFO="/dns/forest-via-gateway/tcp/${FOREST_VIA_GATEWAY_RPC_PORT}/http"
161+
lotus chain head || exit 1
162+
interval: 10s
163+
retries: 10
164+
start_period: 30s
165+
timeout: 5s
143166
lotus:
144167
depends_on:
145168
init:
@@ -242,9 +265,77 @@ services:
242265
status=$$?
243266
echo "==== API Compare Report ===="
244267
cat /data/api-compare-report/*.json || echo "(Report file not accessible)"
245-
FULLNODE_API_INFO=$$FOREST_API_INFO forest-cli shutdown --force
246268
exit $$status
247269
270+
api-compare-gateway:
271+
depends_on:
272+
lotus-sync-wait:
273+
condition: service_completed_successfully
274+
forest-via-gateway:
275+
condition: service_healthy
276+
forest-wallet-import:
277+
condition: service_completed_successfully
278+
build:
279+
context: ../../../.
280+
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
281+
volumes:
282+
- node-data:/data
283+
- ./filter-list-gateway:/data/filter-list-gateway
284+
networks:
285+
- api-tests
286+
environment:
287+
- RUST_LOG=info,forest::tool::subcommands=debug
288+
- FOREST_RPC_DEFAULT_TIMEOUT=120
289+
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
290+
entrypoint: ["/bin/bash", "-c"]
291+
user: 0:0
292+
command:
293+
- |
294+
set -uxo pipefail
295+
# Test against websocket endpoint for online server
296+
LOTUS_API_INFO="$(cat /data/lotus-token):/dns/lotus/tcp/${LOTUS_RPC_PORT}/ws"
297+
FOREST_API_INFO="$(cat /data/forest-token):/dns/forest-via-gateway/tcp/${FOREST_VIA_GATEWAY_RPC_PORT}/ws"
298+
forest-tool api compare $(ls /data/*.car.zst | tail -n 1) \
299+
--forest $$FOREST_API_INFO \
300+
--lotus $$LOTUS_API_INFO \
301+
--n-tipsets 5 \
302+
--test-criteria-overrides=valid-and-timeout,timeout-and-timeout \
303+
--filter-file /data/filter-list-gateway \
304+
--miner-address ${MINER_ADDRESS} \
305+
--worker-address ${MINER_WORKER_ADDRESS} \
306+
--report-mode=failure-only \
307+
--report-dir=/data/api-compare-gateway-report
308+
309+
status=$$?
310+
echo "==== Gateway API Compare Report ===="
311+
cat /data/api-compare-gateway-report/*.json || echo "(Report file not accessible)"
312+
exit $$status
313+
314+
forest-shutdown:
315+
depends_on:
316+
api-compare:
317+
condition: service_completed_successfully
318+
api-compare-gateway:
319+
condition: service_completed_successfully
320+
build:
321+
context: ../../../.
322+
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
323+
volumes:
324+
- node-data:/data
325+
networks:
326+
- api-tests
327+
environment:
328+
- RUST_LOG=info,forest::tool::subcommands=debug
329+
- FOREST_RPC_DEFAULT_TIMEOUT=120
330+
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
331+
entrypoint: ["/bin/bash", "-c"]
332+
user: 0:0
333+
command:
334+
- |
335+
set -uxo pipefail
336+
export FULLNODE_API_INFO="$(cat /data/forest-token):/dns/forest/tcp/${FOREST_RPC_PORT}/http"
337+
forest-cli shutdown --force
338+
248339
api-compare-offline:
249340
profiles:
250341
- include-offline-rpc
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This list contains methods that are either broken or not supported by `lotus-gateway`.
2+
3+
# not supported
4+
5+
!Filecoin.AuthNew
6+
!Filecoin.BeaconGetEntry
7+
!Filecoin.ChainSetHead
8+
!Filecoin.ChainStatObj
9+
!Filecoin.ChainTipSetWeight
10+
!Filecoin.F3
11+
!Filecoin.GasEstimateGasLimit
12+
!Filecoin.MinerCreateBlock
13+
!Filecoin.MpoolSelect
14+
!Filecoin.NetAddrsListen
15+
!Filecoin.NetAgentVersion
16+
!Filecoin.NetAutoNatStatus
17+
!Filecoin.NetPeers
18+
!Filecoin.NetProtectAdd
19+
!Filecoin.NetProtectList
20+
!Filecoin.NetProtectRemove
21+
!Filecoin.Session
22+
!Filecoin.StartTime
23+
!Filecoin.StateCirculatingSupply
24+
!Filecoin.StateCompute
25+
!Filecoin.StateGetAllAllocations
26+
!Filecoin.StateGetAllClaims
27+
!Filecoin.StateGetAllocationIdForPendingDeal
28+
!Filecoin.StateGetBeaconEntry
29+
!Filecoin.StateGetRandomnessDigestFromTickets
30+
!Filecoin.StateGetRandomnessFromBeacon
31+
!Filecoin.StateGetRandomnessFromTickets
32+
!Filecoin.StateListActors
33+
!Filecoin.StateListMessages
34+
!Filecoin.StateLookupRobustAddress
35+
!Filecoin.StateMarketDeals
36+
!Filecoin.StateMarketParticipants
37+
!Filecoin.StateMinerActiveSectors
38+
!Filecoin.StateMinerAllocated
39+
!Filecoin.StateMinerAvailableBalance
40+
!Filecoin.StateMinerFaults
41+
!Filecoin.StateMinerInitialPledgeForSector
42+
!Filecoin.StateMinerPartitions
43+
!Filecoin.StateMinerRecoveries
44+
!Filecoin.StateMinerSectorAllocated
45+
!Filecoin.StateMinerSectors
46+
!Filecoin.StateSearchMsgLimited
47+
!Filecoin.StateSectorExpiration
48+
!Filecoin.StateSectorPartition
49+
!Filecoin.StateSectorPreCommitInfo
50+
!Filecoin.StateVMCirculatingSupplyInternal
51+
!Filecoin.StateVerifiedRegistryRootKey
52+
!Filecoin.WalletSign
53+
!Filecoin.WalletSignMessage
54+
!Filecoin.WalletValidateAddress
55+
!Filecoin.WalletVerify
56+
57+
# broken
58+
!Filecoin.EthCall
59+
!Filecoin.EthGetBalance
60+
!Filecoin.EthGetBlockReceipts
61+
!Filecoin.EthGetBlockReceiptsLimited
62+
!Filecoin.EthGetFilterLogs
63+
!Filecoin.EthGetTransactionByHash
64+
!Filecoin.EthGetTransactionReceipt
65+
!Filecoin.StateSearchMsg
66+
!Filecoin.StateWaitMsg
67+
!Filecoin.EthSyncing

0 commit comments

Comments
 (0)