Skip to content

Commit 250b3e7

Browse files
committed
debug-14: save state
1 parent 2527473 commit 250b3e7

30 files changed

+943
-119
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM docker.io/redhat/ubi8
2+
3+
RUN dnf update -y
4+
RUN dnf install -y gcc git clang python3 make curl libudev-devel cmake clang openssl-devel systemd-devel pkg-config zlib-devel llvm perl-core
5+
6+
COPY cert.pem* /certs/
7+
RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/cert.pem; fi
8+
RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/pki/tls/cert.pem; fi
9+
10+
WORKDIR /
11+
12+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh
13+
RUN chmod a+x rust.sh && ./rust.sh -y
14+
15+
RUN cd /solana; . ~/.cargo/env && ./cargo nightly -Z unstable-options build

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:/usr/lib64/pkgconfig
4+
export PKG_CONFIG_PATH
5+
6+
# ./cargo nightly clean
7+
./cargo nightly build
8+
9+
cd sdk
10+
11+
../cargo nightly build
12+
13+
cd cargo-build-sbf/
14+
15+
../../cargo nightly build

cargo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ case "$1" in
2424
;;
2525
esac
2626

27-
set -x
28-
exec cargo "+${toolchain}" "${@}"
27+
#set -x
28+
exec cargo "+${toolchain}" -v "${@}"

ci/rust-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.60.0
21+
stable_version=1.65.0
2222
fi
2323

2424
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
@@ -31,7 +31,7 @@ fi
3131
export rust_stable="$stable_version"
3232
export rust_stable_docker_image=solanalabs/rust:"$stable_version"
3333

34-
export rust_nightly=nightly-"$nightly_version"
34+
export rust_nightly="$nightly_version"
3535
export rust_nightly_docker_image=solanalabs/rust-nightly:"$nightly_version"
3636

3737
[[ -z $1 ]] || (

doit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#podman build -t solana-builder2 -f Dockerfile -v `pwd`:/solana:rw .
3+
#podman build --no-cache -t solana-builder2 -f Dockerfile -v `pwd`:/solana:rw .
4+
#podman run --mount=type=bind,target=/solana,source=`pwd` -t solana-builder2 bash -c 'cd /solana; . ~/.cargo/env && ./cargo nightly -Z unstable-options build'
5+
6+
# podman run --mount=type=bind,target=/solana,source=/home/jsiegel/repos/solana -t solana-builder2 bash -c 'cd /solana; . ~/.cargo/env && ./cargo build'
7+
8+
9+
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:/usr/lib64/pkgconfig
10+
export PKG_CONFIG_PATH
11+
12+
./cargo nightly -Z unstable-options build
13+
# ./cargo nightly test --package solana-runtime --lib -- system_instruction_processor::tests --nocapture
14+
15+
# /home/jsiegel/repos/solana/target/debug/deps/solana_runtime-13b3b7db3fedc08a 'system_instruction_processor::tests' --nocapture
16+

gen_test.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
3+
PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:/usr/lib64/pkgconfig
4+
export PKG_CONFIG_PATH
5+
6+
# ./cargo nightly clean
7+
./cargo nightly build
8+
9+
#./cargo nightly test --package solana-sdk --lib -- ed25519_instruction::test::test_message_data_offsets --nocapture > out
10+
11+
export RUST_BACKTRACE=1
12+
#./cargo nightly test --package solana-runtime --lib -- system_instruction_processor::tests::test_create_from_account_is_nonce_fail --nocapture > out
13+
14+
./cargo nightly test --workspace --lib -- tests --nocapture > out
15+
grep test_case_json out | sed -e 's/.*test_case_json//' -e 's/$/,/' | sort -u > ../firedancer-testbins/v14-tests.json
16+
17+
export MAINNET=1
18+
./cargo nightly test --workspace --lib -- tests --nocapture > out
19+
grep test_case_json out | sed -e 's/.*test_case_json//' -e 's/$/,/' | sort -u > ../firedancer-testbins/v14-mainnet.json
20+
21+
# grep 'test_sign {' out | sed -e 's/.*test_sign {/{/' -e 's/$/,/' -e 's///' | sort > signs.json
22+
23+
# grep test_transfer_lamports out.json
24+
25+
# modified: gen_test.sh
26+
# modified: program-runtime/src/invoke_context.rs
27+
# modified: sdk/src/ed25519_instruction.rs
28+
# modified: sdk/src/secp256k1_instruction.rs

ledger/src/leader_schedule.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ use {
66
std::{collections::HashMap, convert::identity, ops::Index, sync::Arc},
77
};
88

9+
use std::backtrace::Backtrace;
10+
use log::info;
11+
912
// Used for testing
1013
#[derive(Clone, Debug)]
1114
pub struct FixedSchedule {
@@ -23,6 +26,9 @@ pub struct LeaderSchedule {
2326
impl LeaderSchedule {
2427
// Note: passing in zero stakers will cause a panic.
2528
pub fn new(ids_and_stakes: &[(Pubkey, u64)], seed: [u8; 32], len: u64, repeat: u64) -> Self {
29+
let bt = Backtrace::capture();
30+
info!("LeaderSchedule::ids {:?} {:?} {} {} {}", ids_and_stakes, seed, len, repeat, bt);
31+
2632
let (ids, stakes): (Vec<_>, Vec<_>) = ids_and_stakes.iter().cloned().unzip();
2733
let rng = &mut ChaChaRng::from_seed(seed);
2834
let weighted_index = WeightedIndex::new(stakes).unwrap();

perf/src/thread.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,33 @@ mod tests {
7272
#[cfg(target_os = "linux")]
7373
use super::*;
7474

75-
#[cfg(target_os = "linux")]
76-
#[test]
77-
fn test_nice() {
78-
// No change / get current niceness
79-
let niceness = nice(0).unwrap();
80-
81-
// Decrease priority (allowed for unprivileged processes)
82-
let result = std::thread::spawn(|| nice(1)).join().unwrap();
83-
assert_eq!(result, Ok(niceness + 1));
84-
85-
// Sanity check: ensure that current thread's nice value not changed after previous call
86-
// from different thread
87-
assert_eq!(nice(0), Ok(niceness));
88-
89-
// Sanity check: ensure that new thread inherits nice value from current thread
90-
let inherited_niceness = std::thread::spawn(|| {
91-
nice(1).unwrap();
92-
std::thread::spawn(|| nice(0).unwrap()).join().unwrap()
93-
})
94-
.join()
95-
.unwrap();
96-
assert_eq!(inherited_niceness, niceness + 1);
97-
98-
if !is_renice_allowed(-1) {
99-
// Increase priority (not allowed for unprivileged processes)
100-
let result = std::thread::spawn(|| nice(-1)).join().unwrap();
101-
assert!(result.is_err());
102-
}
103-
}
75+
// #[cfg(target_os = "linux")]
76+
// #[test]
77+
// fn test_nice() {
78+
// // No change / get current niceness
79+
// let niceness = nice(0).unwrap();
80+
//
81+
// // Decrease priority (allowed for unprivileged processes)
82+
// let result = std::thread::spawn(|| nice(1)).join().unwrap();
83+
// assert_eq!(result, Ok(niceness + 1));
84+
//
85+
// // Sanity check: ensure that current thread's nice value not changed after previous call
86+
// // from different thread
87+
// assert_eq!(nice(0), Ok(niceness));
88+
//
89+
// // Sanity check: ensure that new thread inherits nice value from current thread
90+
// let inherited_niceness = std::thread::spawn(|| {
91+
// nice(1).unwrap();
92+
// std::thread::spawn(|| nice(0).unwrap()).join().unwrap()
93+
// })
94+
// .join()
95+
// .unwrap();
96+
// assert_eq!(inherited_niceness, niceness + 1);
97+
//
98+
// if !is_renice_allowed(-1) {
99+
// // Increase priority (not allowed for unprivileged processes)
100+
// let result = std::thread::spawn(|| nice(-1)).join().unwrap();
101+
// assert!(result.is_err());
102+
// }
103+
// }
104104
}

program-runtime/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ solana-metrics = { path = "../metrics", version = "=1.14.22" }
2828
solana-sdk = { path = "../sdk", version = "=1.14.22" }
2929
thiserror = "1.0"
3030
enum-iterator = "0.8.1"
31+
serde_with = "*"
32+
serde_json = "*"
33+
hex-serde = "*"
3134

3235
[dev-dependencies]
3336
solana-logger = { path = "../logger", version = "=1.14.22" }

0 commit comments

Comments
 (0)