Skip to content

Commit ff4009f

Browse files
authored
Bump solana 2 (#181)
* Bump solana * Update comment * Fix patch Co-authored-by: Guillermo Bescos <guibescos>
1 parent 467641d commit ff4009f

File tree

5 files changed

+11
-23
lines changed

5 files changed

+11
-23
lines changed

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
branches: [ main ]
77

88
env:
9-
SOLANA_VERSION: 1.7.12
9+
SOLANA_VERSION: 1.10.29
1010
DOCKER_HUB: docker.io
1111
DOCKER_USER: ${{ secrets.DOCKER_IO_USER }}
1212
IS_RELEASE: ${{

program/src/oracle/upd_aggregate.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "model/price_model.c" /* FIXME: HACK TO DEAL WITH DOCKER LINKAGE ISSUES */
66
#include "pd.h"
77

8-
#include <limits.h>
98

109
#ifdef __cplusplus
1110
extern "C" {

program/src/oracle/util/compat_stdint.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
types and that can conflicts with stdint.h)
99
Defaults to 0 or 1 depending on if __bpf__ is set. */
1010

11+
1112
#ifndef PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE
12-
#ifndef __bpf__
13+
#if !defined(__bpf__) && !defined(SOL_TEST)
1314
#define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 0
1415
#else
1516
#define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 1
1617
#endif
1718
#endif
1819

20+
1921
#if PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE==0
2022
#include <stdint.h>
2123
#elif PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE==1

scripts/patch-solana.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Patch BPF makefile and solana_sdk.h:
44
# - Build with `-Wall -Wextra -Wconversion`.
5-
# - Link with `-z defs` and mark `sol_invoke_signed_c` as weak.
5+
# - Link with `-z defs`.
66
# - Add TEST_FLAGS for criterion CLI.
77
#
88

scripts/solana.patch

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/sdk/bpf/c/bpf.mk b/sdk/bpf/c/bpf.mk
2-
index 4b3039db1..018e8deb4 100644
2+
index 541629ad49..8c2ec94041 100644
33
--- a/sdk/bpf/c/bpf.mk
44
+++ b/sdk/bpf/c/bpf.mk
55
@@ -14,6 +14,12 @@ TEST_PREFIX ?= test_
@@ -13,9 +13,9 @@ index 4b3039db1..018e8deb4 100644
1313
+endif
1414
+
1515
LLVM_DIR = $(LOCAL_PATH)../dependencies/bpf-tools/llvm
16-
LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/12.0.1/include
16+
LLVM_SYSTEM_INC_DIRS := $(LLVM_DIR)/lib/clang/13.0.0/include
1717
COMPILER_RT_DIR = $(LOCAL_PATH)../dependencies/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib
18-
@@ -31,6 +37,9 @@ SYSTEM_INC_DIRS := \
18+
@@ -33,6 +39,9 @@ SYSTEM_INC_DIRS := \
1919
$(LLVM_SYSTEM_INC_DIRS) \
2020

2121
C_FLAGS := \
@@ -25,32 +25,19 @@ index 4b3039db1..018e8deb4 100644
2525
-Werror \
2626
-O2 \
2727
-fno-builtin \
28-
@@ -59,6 +68,7 @@ BPF_CXX_FLAGS := \
28+
@@ -68,6 +77,7 @@ BPF_CXX_FLAGS := \
2929
-march=bpfel+solana
3030

3131
BPF_LLD_FLAGS := \
3232
+ -z defs \
3333
-z notext \
3434
-shared \
3535
--Bdynamic \
36-
@@ -195,7 +205,7 @@ endef
37-
define TEST_EXEC_RULE
36+
@@ -245,6 +255,7 @@ define TEST_EXEC_RULE
3837
$1: $2
3938
LD_LIBRARY_PATH=$(TESTFRAMEWORK_RPATH) \
40-
- $2$(\n)
39+
$2$(\n)
4140
+ $2 $(TEST_FLAGS)$(\n)
4241
endef
4342

4443
.PHONY: $(INSTALL_SH)
45-
diff --git a/sdk/bpf/c/inc/solana_sdk.h b/sdk/bpf/c/inc/solana_sdk.h
46-
index b5cad9833..b3b496123 100644
47-
--- a/sdk/bpf/c/inc/solana_sdk.h
48-
+++ b/sdk/bpf/c/inc/solana_sdk.h
49-
@@ -565,6 +565,7 @@ uint64_t sol_try_find_program_address(
50-
/**
51-
* Internal cross-program invocation function
52-
*/
53-
+__attribute__(( weak ))
54-
uint64_t sol_invoke_signed_c(
55-
const SolInstruction *instruction,
56-
const SolAccountInfo *account_infos,

0 commit comments

Comments
 (0)