Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
3 changes: 2 additions & 1 deletion scripts/tests/api_compare/.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Note: this should be a `fat` image so that it contains the pre-downloaded filecoin proof parameters
FOREST_IMAGE=ghcr.io/chainsafe/forest:edge-fat
LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.4-rc1-calibnet
LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.4-calibnet
FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
LOTUS_RPC_PORT=1234
FOREST_RPC_PORT=2345
FOREST_OFFLINE_RPC_PORT=3456
FOREST_VIA_GATEWAY_RPC_PORT=4567
Comment thread
LesnyRumcajs marked this conversation as resolved.
FOREST_HEALTHZ_RPC_PORT=2346
CHAIN=calibnet
Comment thread
hanabi1224 marked this conversation as resolved.

Expand Down
97 changes: 92 additions & 5 deletions scripts/tests/api_compare/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,29 @@ services:
timeout: 3s
retries: 3
start_period: 10m
forest-via-gateway:
depends_on:
forest-rpc-ready:
condition: service_completed_successfully
image: ${LOTUS_IMAGE}
volumes:
- node-data:/data
networks:
- api-tests
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euxo pipefail
export FULLNODE_API_INFO="$(cat /data/forest-token):/dns/forest/tcp/${FOREST_RPC_PORT}/http"
lotus-gateway run --api-max-lookback 72000h --listen 0.0.0.0:${FOREST_VIA_GATEWAY_RPC_PORT}
healthcheck:
test: |
export FULLNODE_API_INFO="/dns/forest-via-gateway/tcp/${FOREST_VIA_GATEWAY_RPC_PORT}/http"
lotus chain head || exit 1
interval: 10s
retries: 10
start_period: 30s
timeout: 5s
lotus:
depends_on:
init:
Expand Down Expand Up @@ -198,10 +221,6 @@ services:
lotus sync wait
# After the sync is done, import the wallet for signing blocks. It might be already there, which will return an error. We ignore it.
echo $MINER_WORKER_KEY | lotus wallet import || true
# Wait until F3 certificate instance 100 is available
until lotus f3 c get 100; do
sleep 5s;
done
api-compare:
depends_on:
lotus-sync-wait:
Expand Down Expand Up @@ -246,9 +265,77 @@ services:
status=$$?
echo "==== API Compare Report ===="
cat /data/api-compare-report/*.json || echo "(Report file not accessible)"
FULLNODE_API_INFO=$$FOREST_API_INFO forest-cli shutdown --force
exit $$status

api-compare-gateway:
depends_on:
lotus-sync-wait:
condition: service_completed_successfully
forest-via-gateway:
condition: service_healthy
forest-wallet-import:
condition: service_completed_successfully
build:
context: ../../../.
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
volumes:
- node-data:/data
- ./filter-list-gateway:/data/filter-list-gateway
networks:
- api-tests
environment:
- RUST_LOG=info,forest::tool::subcommands=debug
- FOREST_RPC_DEFAULT_TIMEOUT=120
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
entrypoint: ["/bin/bash", "-c"]
user: 0:0
command:
- |
set -uxo pipefail
# Test against websocket endpoint for online server
LOTUS_API_INFO="$(cat /data/lotus-token):/dns/lotus/tcp/${LOTUS_RPC_PORT}/ws"
FOREST_API_INFO="$(cat /data/forest-token):/dns/forest-via-gateway/tcp/${FOREST_VIA_GATEWAY_RPC_PORT}/ws"
forest-tool api compare $(ls /data/*.car.zst | tail -n 1) \
--forest $$FOREST_API_INFO \
--lotus $$LOTUS_API_INFO \
--n-tipsets 5 \
--test-criteria-overrides=valid-and-timeout,timeout-and-timeout \
--filter-file /data/filter-list-gateway \
--miner-address ${MINER_ADDRESS} \
--worker-address ${MINER_WORKER_ADDRESS} \
--report-mode=failure-only \
--report-dir=/data/api-compare-gateway-report

status=$$?
echo "==== Gateway API Compare Report ===="
cat /data/api-compare-gateway-report/*.json || echo "(Report file not accessible)"
exit $$status

forest-shutdown:
depends_on:
api-compare:
condition: service_completed_successfully
api-compare-gateway:
condition: service_completed_successfully
build:
context: ../../../.
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
volumes:
- node-data:/data
networks:
- api-tests
environment:
- RUST_LOG=info,forest::tool::subcommands=debug
- FOREST_RPC_DEFAULT_TIMEOUT=120
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
entrypoint: ["/bin/bash", "-c"]
user: 0:0
command:
- |
set -uxo pipefail
export FULLNODE_API_INFO="$(cat /data/forest-token):/dns/forest/tcp/${FOREST_RPC_PORT}/http"
forest-cli shutdown --force

Comment thread
hanabi1224 marked this conversation as resolved.
api-compare-offline:
profiles:
- include-offline-rpc
Expand Down
67 changes: 67 additions & 0 deletions scripts/tests/api_compare/filter-list-gateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This list contains methods that are either broken or not supported by `lotus-gateway`.

# not supported

!Filecoin.AuthNew
!Filecoin.BeaconGetEntry
!Filecoin.ChainSetHead
!Filecoin.ChainStatObj
!Filecoin.ChainTipSetWeight
!Filecoin.F3
!Filecoin.GasEstimateGasLimit
!Filecoin.MinerCreateBlock
!Filecoin.MpoolSelect
!Filecoin.NetAddrsListen
!Filecoin.NetAgentVersion
!Filecoin.NetAutoNatStatus
!Filecoin.NetPeers
!Filecoin.NetProtectAdd
!Filecoin.NetProtectList
!Filecoin.NetProtectRemove
!Filecoin.Session
!Filecoin.StartTime
!Filecoin.StateCirculatingSupply
!Filecoin.StateCompute
!Filecoin.StateGetAllAllocations
!Filecoin.StateGetAllClaims
!Filecoin.StateGetAllocationIdForPendingDeal
!Filecoin.StateGetBeaconEntry
!Filecoin.StateGetRandomnessDigestFromTickets
!Filecoin.StateGetRandomnessFromBeacon
!Filecoin.StateGetRandomnessFromTickets
!Filecoin.StateListActors
!Filecoin.StateListMessages
!Filecoin.StateLookupRobustAddress
!Filecoin.StateMarketDeals
!Filecoin.StateMarketParticipants
!Filecoin.StateMinerActiveSectors
!Filecoin.StateMinerAllocated
!Filecoin.StateMinerAvailableBalance
!Filecoin.StateMinerFaults
!Filecoin.StateMinerInitialPledgeForSector
!Filecoin.StateMinerPartitions
!Filecoin.StateMinerRecoveries
!Filecoin.StateMinerSectorAllocated
!Filecoin.StateMinerSectors
!Filecoin.StateSearchMsgLimited
!Filecoin.StateSectorExpiration
!Filecoin.StateSectorPartition
!Filecoin.StateSectorPreCommitInfo
!Filecoin.StateVMCirculatingSupplyInternal
!Filecoin.StateVerifiedRegistryRootKey
!Filecoin.WalletSign
!Filecoin.WalletSignMessage
!Filecoin.WalletValidateAddress
!Filecoin.WalletVerify

# broken
Comment thread
hanabi1224 marked this conversation as resolved.
!Filecoin.EthCall
!Filecoin.EthGetBalance
!Filecoin.EthGetBlockReceipts
!Filecoin.EthGetBlockReceiptsLimited
!Filecoin.EthGetFilterLogs
!Filecoin.EthGetTransactionByHash
!Filecoin.EthGetTransactionReceipt
!Filecoin.StateSearchMsg
!Filecoin.StateWaitMsg
!Filecoin.EthSyncing
Loading