Skip to content

Commit

Permalink
Merge branch 'master' into shred-index-next
Browse files Browse the repository at this point in the history
  • Loading branch information
cpubot authored Jan 11, 2025
2 parents 674d6e7 + 6784c2f commit adb13d6
Show file tree
Hide file tree
Showing 34 changed files with 158 additions and 249 deletions.
14 changes: 8 additions & 6 deletions .github/scripts/downstream-project-spl-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
set -e

here="$(dirname "${BASH_SOURCE[0]}")"
program="$1"

#shellcheck source=ci/downstream-projects/common.sh
source "$here"/../../ci/downstream-projects/common.sh

set -x
rm -rf spl
git clone https://github.com/solana-labs/solana-program-library.git spl
rm -rf "${program}"
git clone https://github.com/solana-program/"${program}".git

# copy toolchain file to use solana's rust version
cp "$SOLANA_DIR"/rust-toolchain.toml spl/
cd spl || exit 1
cp "$SOLANA_DIR"/rust-toolchain.toml "${program}"/
cd "${program}" || exit 1
echo "HEAD: $(git rev-parse HEAD)"

project_used_solana_version=$(sed -nE 's/solana-sdk = \"[>=<~]*(.*)\"/\1/p' <"token/program/Cargo.toml")
project_used_solana_version=$(sed -nE 's/solana = \"(.*)\"/\1/p' <"Cargo.toml")
echo "used solana version: $project_used_solana_version"
if semverGT "$project_used_solana_version" "$SOLANA_VER"; then
echo "skip"
export SKIP_SPL_DOWNSTREAM_PROJECT_TEST=1
return
fi

./patch.crates-io.sh "$SOLANA_DIR"
update_solana_dependencies . "$SOLANA_VER"
patch_crates_io_solana Cargo.toml "$SOLANA_DIR"
2 changes: 1 addition & 1 deletion .github/scripts/downstream-project-spl-install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e

sudo apt-get update
sudo apt-get install libudev-dev binutils-dev libunwind-dev protobuf-compiler -y
sudo apt-get install libudev-dev protobuf-compiler -y
3 changes: 2 additions & 1 deletion .github/workflows/downstream-project-anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ env:

jobs:
test:
if: github.repository == 'anza-xyz/agave'
#if: github.repository == 'anza-xyz/agave'
if: false # restore once all program-specific repos are ready
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
102 changes: 35 additions & 67 deletions .github/workflows/downstream-project-spl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ jobs:
check:
if: github.repository == 'anza-xyz/agave'
runs-on: ubuntu-latest
strategy:
matrix:
programs:
- associated-token-account
- feature-proposal
- instruction-padding
- memo
- record
- single-pool
- slashing
- stake-pool
- token-2022
# re-enable with https://github.com/buffalojoec/mollusk/pull/74
# - token
steps:
- uses: actions/checkout@v4

Expand All @@ -53,45 +67,20 @@ jobs:
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
source .github/scripts/downstream-project-spl-common.sh "${{ matrix.programs }}"
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
cargo check
test:
test_cli:
if: github.repository == 'anza-xyz/agave'
runs-on: ubuntu-latest
strategy:
matrix:
arrays:
[
{
test_paths: ["token/cli"],
required_programs:
[
"token/program",
"token/program-2022",
"associated-token-account/program",
"instruction-padding/program",
],
},
{
test_paths: ["single-pool/cli"],
required_programs:
[
"single-pool/program",
],
},
{
test_paths: ["token-upgrade/cli"],
required_programs:
[
"token-upgrade/program",
],
},
]
programs:
- single-pool
- token-2022
steps:
- uses: actions/checkout@v4

Expand All @@ -106,45 +95,30 @@ jobs:
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
source .github/scripts/downstream-project-spl-common.sh "${{ matrix.programs }}"
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
programStr="${{ tojson(matrix.arrays.required_programs) }}"
IFS=', ' read -ra programs <<<"${programStr//[\[\]$'\n'$'\r' ]/}"
for program in "${programs[@]}"; do
$CARGO_BUILD_SBF --manifest-path "$program"/Cargo.toml
done
testPathsStr="${{ tojson(matrix.arrays.test_paths) }}"
IFS=', ' read -ra test_paths <<<"${testPathsStr//[\[\]$'\n'$'\r' ]/}"
for test_path in "${test_paths[@]}"; do
cargo test --manifest-path "$test_path"/Cargo.toml
done
$CARGO_BUILD_SBF --manifest-path program/Cargo.toml
cargo test --manifest-path clients/cli/Cargo.toml
cargo-test-sbf:
if: github.repository == 'anza-xyz/agave'
runs-on: ubuntu-latest
strategy:
matrix:
programs:
- [token/program]
- [
instruction-padding/program,
token/program-2022,
token/program-2022-test,
]
- [
associated-token-account/program,
associated-token-account/program-test,
]
- [token-upgrade/program]
- [feature-proposal/program]
- [governance/addin-mock/program, governance/program]
- [name-service/program]
- [stake-pool/program]
- [single-pool/program]
- associated-token-account
- feature-proposal
- instruction-padding
- memo
- record
- single-pool
- slashing
- stake-pool
- token-2022
# re-enable with https://github.com/buffalojoec/mollusk/pull/74
# - token
steps:
- uses: actions/checkout@v4

Expand All @@ -159,14 +133,8 @@ jobs:
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
source .github/scripts/downstream-project-spl-common.sh "${{ matrix.programs }}"
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
programStr="${{ tojson(matrix.programs) }}"
IFS=', ' read -ra programs <<<"${programStr//[\[\]$'\n'$'\r' ]/}"
for program in "${programs[@]}"; do
$CARGO_TEST_SBF --manifest-path "$program"/Cargo.toml
done
$CARGO_TEST_SBF --manifest-path program/Cargo.toml
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Release channels have their own copy of this changelog:
* Changes
* CLI:
* Add global `--skip-preflight` option for skipping preflight checks on all transactions sent through RPC. This flag, along with `--use-rpc`, can improve success rate with program deployments using the public RPC nodes.
* Unhide `--accounts-db-access-storages-method` for agave-validator and agave-ledger-tool
* Unhide `--accounts-db-access-storages-method` for agave-validator and agave-ledger-tool and change default to `file`
* Remove tracer stats from banking-trace. `banking-trace` directory should be cleared when restarting on v2.2 for first time. It will not break if not cleared, but the file will be a mix of new/old format. (#4043)

## [2.1.0]
Expand Down
45 changes: 18 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 1 addition & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ test-case = "3.3.1"
thiserror = "2.0.9"
tiny-bip39 = "0.8.2"
# Update solana-tokio patch below when updating this version
tokio = "1.29.1"
tokio = "1.43.0"
tokio-serde = "0.8"
tokio-stream = "0.1.17"
tokio-tungstenite = "0.20.1"
Expand Down Expand Up @@ -736,21 +736,3 @@ solana-zk-sdk = { path = "zk-sdk" }
# we override the opt-level to 3 for the crate.
[profile.dev.package.curve25519-dalek]
opt-level = 3

# Solana RPC nodes experience stalls when running with `tokio` containing this
# commit:
# https://github.com/tokio-rs/tokio/commit/4eed411519783ef6f58cbf74f886f91142b5cfa6
#
# Tokio maintainers believe performance degradation is due to application bugs:
# https://github.com/tokio-rs/tokio/issues/4873#issuecomment-1198277677
#
# This may indeed be true of the code in this monorepo, but we haven't yet
# identified the bug or a way to fix. As a stopgap, this patches `tokio` to the
# tagged version specified above with commit `4eed411` reverted.
#
# Comparison:
# https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...solana-labs:solana-tokio:tokio-1.29.1-revert-4eed411
#
[patch.crates-io.tokio]
git = "https://github.com/anza-xyz/solana-tokio.git"
rev = "7cf47705faacf7bf0e43e4131a5377b3291fce21"
4 changes: 1 addition & 3 deletions accounts-db/src/account_locks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ impl AccountLocks {

#[cfg_attr(feature = "dev-context-only-utils", qualifiers(pub))]
fn is_locked_readonly(&self, key: &Pubkey) -> bool {
self.readonly_locks
.get(key)
.map_or(false, |count| *count > 0)
self.readonly_locks.get(key).is_some_and(|count| *count > 0)
}

#[cfg_attr(feature = "dev-context-only-utils", qualifiers(pub))]
Expand Down
Loading

0 comments on commit adb13d6

Please sign in to comment.