Skip to content

Commit

Permalink
feat: remove gossip code
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove gossip as royalties will be collected via DAG
  • Loading branch information
joshuef committed Mar 25, 2024
1 parent f9acc4e commit 8cbf550
Show file tree
Hide file tree
Showing 47 changed files with 156 additions and 1,992 deletions.
113 changes: 0 additions & 113 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,56 +518,6 @@ jobs:
log_file_prefix: safe_test_logs_e2e
platform: ${{ matrix.os }}

gossipsub:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: Gossipsub E2E tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Build binaries
run: cargo build --release --bin safenode --bin faucet
timeout-minutes: 30

- name: Build gossipsub testing executable
run: cargo test --release -p sn_node --features=local-discovery --test msgs_over_gossipsub --no-run
env:
# only set the target dir for windows to bypass the linker issue.
# happens if we build the node manager via testnet action
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/sn-local-testnet-action@main
with:
action: start
interval: 2000
node-path: target/release/safenode
faucet-path: target/release/faucet
platform: ${{ matrix.os }}
build: true

- name: Gossipsub - nodes to subscribe to topics, and publish messages
run: cargo test --release -p sn_node --features local-discovery --test msgs_over_gossipsub -- --nocapture
env:
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 20

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/sn-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_gossipsub_e2e
platform: ${{ matrix.os }}

spend_test:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: spend tests against network
Expand Down Expand Up @@ -637,69 +587,6 @@ jobs:
log_file_prefix: safe_test_logs_spend
platform: ${{ matrix.os }}

royalty_reward_test:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: royalty_reward tests against network
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Build binaries
run: cargo build --release --features=local-discovery,royalties-by-gossip --bin safenode --bin faucet
timeout-minutes: 30

- name: Build testing executable
run: cargo test --release -p sn_node --features=local-discovery,royalties-by-gossip --test nodes_rewards --no-run
env:
# only set the target dir for windows to bypass the linker issue.
# happens if we build the node manager via testnet action
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/sn-local-testnet-action@main
with:
action: start
interval: 2000
node-path: target/release/safenode
faucet-path: target/release/faucet
platform: ${{ matrix.os }}
build: true

- name: Check SAFE_PEERS was set
shell: bash
run: |
if [[ -z "$SAFE_PEERS" ]]; then
echo "The SAFE_PEERS variable has not been set"
exit 1
else
echo "SAFE_PEERS has been set to $SAFE_PEERS"
fi
# This should be first to avoid slow reward acceptance etc
- name: execute the nodes rewards tests
run: cargo test --release -p sn_node --features=local-discovery,royalties-by-gossip --test nodes_rewards -- --nocapture --test-threads=1
env:
SN_LOG: "all"
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 25

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/sn-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_royalty_reward
platform: ${{ matrix.os }}

token_distribution_test:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: token distribution test
Expand Down
115 changes: 0 additions & 115 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,56 +179,6 @@ jobs:
SLACK_MESSAGE: "Please check the logs for the run at ${{ env.WORKFLOW_URL }}/${{ github.run_id }}"
SLACK_TITLE: "Nightly Unit Test Run Failed"

gossipsub:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: Gossipsub E2E tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Build binaries
run: cargo build --release --bin safenode --bin faucet
timeout-minutes: 30

- name: Build gossipsub testing executable
run: cargo test --release -p sn_node --features=local-discovery --test msgs_over_gossipsub --no-run
env:
# only set the target dir for windows to bypass the linker issue.
# happens if we build the node manager via testnet action
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/sn-local-testnet-action@main
with:
action: start
interval: 2000
node-path: target/release/safenode
faucet-path: target/release/faucet
platform: ${{ matrix.os }}
build: true

- name: Gossipsub - nodes to subscribe to topics, and publish messages
run: cargo test --release -p sn_node --features local-discovery --test msgs_over_gossipsub -- --nocapture
env:
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 20

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/sn-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_gossipsub_e2e
platform: ${{ matrix.os }}

spend_test:
name: spend tests against network
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -300,71 +250,6 @@ jobs:
SLACK_MESSAGE: "Please check the logs for the run at ${{ env.WORKFLOW_URL }}/${{ github.run_id }}"
SLACK_TITLE: "Nightly Spend Test Run Failed"

royalty_reward_test:
name: royalty_reward tests against network
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
continue-on-error: true

- name: Build binaries
run: cargo build --release --features=local-discovery,royalties-by-gossip --bin safenode --bin faucet
timeout-minutes: 30

- name: Build testing executable
run: cargo test --release -p sn_node --features=local-discovery,royalties-by-gossip --test nodes_rewards --no-run
env:
# only set the target dir for windows to bypass the linker issue.
# happens if we build the node manager via testnet action
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 30

- name: Start a local network
uses: maidsafe/sn-local-testnet-action@main
with:
action: start
interval: 2000
node-path: target/release/safenode
faucet-path: target/release/faucet
platform: ${{ matrix.os }}
build: true

# This should be first to avoid slow reward acceptance etc
- name: execute the nodes rewards tests
run: cargo test --release -p sn_node --features=local-discovery,royalties-by-gossip --test nodes_rewards -- --nocapture --test-threads=1
env:
SN_LOG: "all"
CARGO_TARGET_DIR: ${{ matrix.os == 'windows-latest' && './test-target' || '.' }}
timeout-minutes: 25

- name: Small wait to allow reward receipt
run: sleep 30
timeout-minutes: 1

- name: Stop the local network and upload logs
if: always()
uses: maidsafe/sn-local-testnet-action@main
with:
action: stop
log_file_prefix: safe_test_logs_royalty_reward
platform: ${{ matrix.os }}

- name: post notification to slack on failure
if: ${{ failure() }}
uses: bryannice/[email protected]
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_GH_ACTIONS_WEBHOOK_URL }}
SLACK_MESSAGE: "Please check the logs for the run at ${{ env.WORKFLOW_URL }}/${{ github.run_id }}"
SLACK_TITLE: "Nightly Royalty Reward Test Run Failed"

token_distribution_test:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: token distribution test
Expand Down
Loading

0 comments on commit 8cbf550

Please sign in to comment.