Skip to content

Commit

Permalink
Merge branch 'master' into crispheaney/only-run-verified-build-when-need
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Jul 8, 2024
2 parents d6ddb3c + 0e33784 commit 0cffe5d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 27 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ name: Soteria

on:
push:
branches:
branches:
- master
pull_request:
branches:
branches:
- master

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.9.5"
PROGRAM_PATH: "programs/drift/"
PROGRAM_PATH: "programs/drift/"
RUST_TOOLCHAIN: nightly-2022-02-07

jobs:
build:
name: Soteria Scan
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- name: Checkout changes
uses: actions/checkout@v2

- name: Cache Solana Version
uses: actions/cache@v2
id: solana-cache
Expand All @@ -31,7 +31,7 @@ jobs:
~/.cache/solana
~/.local/share/solana
key: solana-v${{ env.SOLANA_VERSION }}

- name: Cache Soteria Build
uses: Swatinem/rust-cache@v1
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
fmt-clippy:
name: fmt & clippy
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- uses: actions/checkout@v2
- name: Install Rust nightly
Expand All @@ -37,7 +37,7 @@ jobs:
run: cargo clippy -p drift
unit:
name: Unit tests
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
Expand All @@ -55,7 +55,7 @@ jobs:
# disable until solana-client is upgraded
# cargo-audit:
# name: Cargo audit
# runs-on: ubuntu-latest
# runs-on: ubicloud
# steps:
# - uses: actions/checkout@v2
# - name: Cache cargo-audit version
Expand All @@ -68,7 +68,7 @@ jobs:
# - name: Run cargo-audit # Using args from .cargo/audit.toml
# run: cargo audit
yarn-prettier:
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- uses: actions/checkout@v2
- name: Setup node
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Run prettier
run: yarn prettify
yarn-lint:
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- uses: actions/checkout@v2
- name: Setup node
Expand All @@ -96,7 +96,7 @@ jobs:
- name: Run lint
run: yarn lint
anchor-tests:
runs-on: ubuntu-latest
runs-on: ubicloud
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
- name: run anchor tests
run: bash test-scripts/run-anchor-tests.sh
check-for-sdk-changes:
runs-on: ubuntu-latest
runs-on: ubicloud
# Set job outputs to values from filter step
outputs:
sdk: ${{ steps.filter.outputs.sdk }}
Expand All @@ -157,7 +157,7 @@ jobs:
sdk:
- 'sdk/**'
release:
runs-on: ubuntu-latest
runs-on: ubicloud
needs:
[
fmt-clippy,
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
emit-dispatch-events:
runs-on: ubuntu-latest
runs-on: ubicloud
needs: [release, check-for-sdk-changes]
if: ${{ github.ref == 'refs/heads/master' && needs.check-for-sdk-changes.outputs.sdk == 'true' }}
strategy:
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
- 'programs/drift/Cargo.toml'
verified-build:
name: Build Verifiable Artifact
runs-on: ubuntu-latest
runs-on: ubicloud
needs:
[
check-for-program-version-changes,
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Security Scans

on:
push:
branches:
branches:
- master
pull_request:
branches:
branches:
- master

jobs:
monitor:
name: Sync with snyk.io
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- uses: actions/checkout@master
- name: Monitor on snyk.io
Expand All @@ -23,17 +23,17 @@ jobs:
sast:
needs: monitor
name: Code Scan
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- name: Checkout changes
uses: actions/checkout@v2

- uses: snyk/actions/setup@master
- name: Snyk Code Scan
run: snyk code test --org=${{ secrets.SNYK_ORG }} --severity-threshold=medium --sarif-file-output=snyk-sast.json
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Upload code report
if: always()
uses: github/codeql-action/upload-sarif@v1
Expand All @@ -42,18 +42,18 @@ jobs:
sca:
needs: monitor
name: Dependency Scan
runs-on: ubuntu-latest
runs-on: ubicloud
steps:
- name: Checkout changes
uses: actions/checkout@v2

- name: Snyk Dependency Scan
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --org=${{ secrets.SNYK_ORG }} --severity-threshold=medium --fail-on=upgradable --sarif-file-output=snyk-sca.sarif

- name: Upload dependency report
if: always()
uses: github/codeql-action/upload-sarif@v1
Expand Down
2 changes: 1 addition & 1 deletion sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.86.0-beta.1
2.86.0-beta.2
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drift-labs/sdk",
"version": "2.86.0-beta.1",
"version": "2.86.0-beta.2",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"author": "crispheaney",
Expand Down
10 changes: 10 additions & 0 deletions sdk/src/constants/perpMarkets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,16 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
launchTs: 1719415157000,
oracleSource: OracleSource.SWITCHBOARD,
},
{
fullName: 'POPCAT',
category: ['Meme', 'Solana'],
symbol: 'POPCAT-PERP',
baseAssetSymbol: 'POPCAT',
marketIndex: 34,
oracle: new PublicKey('2stQe1XLGkuTZ22gQrgZKsb93iG9mWXSLfANMPRjs5Ky'),
launchTs: 1720013054000,
oracleSource: OracleSource.SWITCHBOARD,
},
];

export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
Expand Down
13 changes: 13 additions & 0 deletions sdk/src/constants/spotMarkets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,19 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
precisionExp: SIX,
launchTs: 1719415157000,
},
{
symbol: 'POPCAT',
marketIndex: 20,
oracle: new PublicKey('2stQe1XLGkuTZ22gQrgZKsb93iG9mWXSLfANMPRjs5Ky'),
oracleSource: OracleSource.SWITCHBOARD,
mint: new PublicKey('7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr'),
precision: new BN(10).pow(NINE),
precisionExp: NINE,
launchTs: 1720013054000,
phoenixMarket: new PublicKey(
'31XgvAQ1HgFQEk31KdszbPkVXKaQqB1bgYZPoDrFpSR2'
),
},
];

export const SpotMarkets: { [key in DriftEnv]: SpotMarketConfig[] } = {
Expand Down
4 changes: 4 additions & 0 deletions tests/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ export async function initializeQuoteSpotMarket(
maintenanceLiabilityWeight,
imfFactor
);

// @ts-ignore
admin.accountSubscriber.spotOracleMap.set(0, PublicKey.default);

await admin.updateWithdrawGuardThreshold(
marketIndex,
new BN(10 ** 10).mul(QUOTE_PRECISION)
Expand Down

0 comments on commit 0cffe5d

Please sign in to comment.