Skip to content

Commit 4c809de

Browse files
committed
Merge branch 'testnet' into archive-sync
2 parents 7f039fa + 9f73303 commit 4c809de

File tree

14 files changed

+638
-592
lines changed

14 files changed

+638
-592
lines changed

.github/workflows/docker-ubuntu-branch-image.yml

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,26 @@ env:
1111
IMAGE_NAME: ${{ github.repository }}
1212

1313
jobs:
14-
build-and-push:
15-
runs-on: ubuntu-22.04
14+
build-arm64:
15+
runs-on: ubuntu-22.04-arm
1616
steps:
1717
- name: Check out repository
1818
uses: actions/checkout@v3
1919
with:
2020
submodules: 'recursive'
2121

22+
- name: Get tag as branch name
23+
id: tag
24+
run: |
25+
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
26+
2227
- name: Set up QEMU
2328
uses: docker/[email protected]
2429

2530
- name: Set up Docker Buildx
2631
uses: docker/[email protected]
2732
with:
28-
driver-opts: image=moby/buildkit:v0.11.0
33+
driver-opts: image=moby/buildkit:v0.20.2
2934

3035
- name: Login to GitHub Container Registry
3136
uses: docker/login-action@v3
@@ -34,28 +39,80 @@ jobs:
3439
username: ${{ github.repository_owner }}
3540
password: ${{ secrets.GITHUB_TOKEN }}
3641

37-
- name: Build and export to Docker
42+
- name: Build and push
3843
uses: docker/build-push-action@v6
3944
with:
40-
load: true
45+
platforms: linux/arm64
46+
push: true
4147
context: ./
42-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
48+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64
4349

44-
- name: Test
45-
run: |
46-
docker run --rm -e "TEST=1" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
50+
51+
build-amd64:
52+
runs-on: ubuntu-22.04
53+
steps:
54+
- name: Check out repository
55+
uses: actions/checkout@v3
56+
with:
57+
submodules: 'recursive'
4758

4859
- name: Get tag as branch name
4960
id: tag
5061
run: |
5162
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
5263
64+
- name: Set up QEMU
65+
uses: docker/[email protected]
66+
67+
- name: Set up Docker Buildx
68+
uses: docker/[email protected]
69+
with:
70+
driver-opts: image=moby/buildkit:v0.20.2
71+
72+
- name: Login to GitHub Container Registry
73+
uses: docker/login-action@v3
74+
with:
75+
registry: ${{ env.REGISTRY }}
76+
username: ${{ github.repository_owner }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
5379
- name: Build and push
54-
id: docker_build
5580
uses: docker/build-push-action@v6
5681
with:
57-
platforms: linux/amd64,linux/arm64
82+
platforms: linux/amd64
5883
push: true
5984
context: ./
60-
tags: |
61-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}
85+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64
86+
87+
88+
merge:
89+
runs-on: ubuntu-22.04
90+
needs:
91+
- build-amd64
92+
- build-arm64
93+
steps:
94+
- name: Get tag as branch name
95+
id: tag
96+
run: |
97+
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
98+
99+
- name: Login to GitHub Container Registry
100+
uses: docker/login-action@v3
101+
with:
102+
registry: ${{ env.REGISTRY }}
103+
username: ${{ github.repository_owner }}
104+
password: ${{ secrets.GITHUB_TOKEN }}
105+
106+
- name: Set up Docker Buildx
107+
uses: docker/[email protected]
108+
109+
- name: Create manifest list and push
110+
run: |
111+
docker buildx imagetools create \
112+
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }} \
113+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64 \
114+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64
115+
116+
- name: Inspect image
117+
run: |
118+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}

.github/workflows/docker-ubuntu-image.yml

Lines changed: 84 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ env:
1111
IMAGE_NAME: ${{ github.repository }}
1212

1313
jobs:
14-
build-and-push:
15-
runs-on: ubuntu-22.04
14+
build-arm64:
15+
runs-on: ubuntu-22.04-arm
1616
steps:
1717
- name: Check out repository
1818
uses: actions/checkout@v3
@@ -32,16 +32,47 @@ jobs:
3232
username: ${{ github.repository_owner }}
3333
password: ${{ secrets.GITHUB_TOKEN }}
3434

35-
- name: Build and export to Docker
35+
- name: Get next tag
36+
id: tag
37+
run: |
38+
git fetch --all --tags
39+
git tag -l
40+
NEW_TAG=v$(date +'%Y.%m')
41+
FOUND=$(git tag -l | grep $NEW_TAG | wc -l)
42+
if [ $FOUND -eq 0 ]; then
43+
echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT
44+
else
45+
echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT
46+
fi
47+
48+
- name: Build and push
3649
uses: docker/build-push-action@v6
3750
with:
38-
load: true
51+
platforms: linux/arm64
52+
push: true
3953
context: ./
40-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
54+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64
4155

42-
- name: Test
43-
run: |
44-
docker run --rm -e "TEST=1" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
56+
build-amd64:
57+
runs-on: ubuntu-22.04
58+
steps:
59+
- name: Check out repository
60+
uses: actions/checkout@v3
61+
with:
62+
submodules: 'recursive'
63+
64+
- name: Set up QEMU
65+
uses: docker/[email protected]
66+
67+
- name: Set up Docker Buildx
68+
uses: docker/[email protected]
69+
70+
- name: Login to GitHub Container Registry
71+
uses: docker/login-action@v3
72+
with:
73+
registry: ${{ env.REGISTRY }}
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
4576

4677
- name: Get next tag
4778
id: tag
@@ -57,12 +88,52 @@ jobs:
5788
fi
5889
5990
- name: Build and push
60-
id: docker_build
6191
uses: docker/build-push-action@v6
6292
with:
63-
platforms: linux/amd64,linux/arm64
93+
platforms: linux/amd64
6494
push: true
6595
context: ./
66-
tags: |
67-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
68-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}
96+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64
97+
98+
merge:
99+
runs-on: ubuntu-22.04
100+
needs:
101+
- build-amd64
102+
- build-arm64
103+
steps:
104+
- name: Check out repository
105+
uses: actions/checkout@v3
106+
107+
- name: Get next tag
108+
id: tag
109+
run: |
110+
git fetch --all --tags
111+
git tag -l
112+
NEW_TAG=v$(date +'%Y.%m')
113+
FOUND=$(git tag -l | grep $NEW_TAG | wc -l)
114+
if [ $FOUND -eq 0 ]; then
115+
echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT
116+
else
117+
echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT
118+
fi
119+
120+
- name: Login to GitHub Container Registry
121+
uses: docker/login-action@v3
122+
with:
123+
registry: ${{ env.REGISTRY }}
124+
username: ${{ github.repository_owner }}
125+
password: ${{ secrets.GITHUB_TOKEN }}
126+
127+
- name: Set up Docker Buildx
128+
uses: docker/[email protected]
129+
130+
- name: Create manifest list and push
131+
run: |
132+
docker buildx imagetools create \
133+
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
134+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64 \
135+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64
136+
137+
- name: Inspect image
138+
run: |
139+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ set(CRC32C_BUILD_BENCHMARKS OFF CACHE BOOL "Build CRC32C's benchmarks")
8787
set(CRC32C_USE_GLOG OFF CACHE BOOL "Build CRC32C's tests with Google Logging")
8888
set(CRC32C_INSTALL OFF CACHE BOOL "Install CRC32C's header and library")
8989
message("Add crc32c")
90-
if (NOT MSVC)
91-
set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
92-
# fix aarch64 build @ crc32c/src/crc32c_arm64_linux_check.h
93-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=address")
94-
add_subdirectory(third-party/crc32c EXCLUDE_FROM_ALL)
95-
set(CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
96-
unset(OLD_CMAKE_CXX_FLAGS)
97-
else()
90+
function(crc32_scope)
91+
set(CMAKE_POLICY_VERSION_MINIMUM "3.10")
92+
if (NOT MSVC)
93+
# fix aarch64 build @ crc32c/src/crc32c_arm64_linux_check.h
94+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=address")
95+
endif()
9896
add_subdirectory(third-party/crc32c EXCLUDE_FROM_ALL)
99-
endif()
97+
endfunction()
98+
crc32_scope()
10099
set(CRC32C_FOUND 1)
101100

102101
if (TON_USE_ROCKSDB)

crypto/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ set(TON_CRYPTO_CORE_SOURCE
7070
vm/cells/CellString.h
7171
vm/cells/CellTraits.h
7272
vm/cells/CellUsageTree.h
73-
vm/cells/CellWithStorage.h
7473
vm/cells/DataCell.h
7574
vm/cells/ExtCell.h
7675
vm/cells/LevelMask.h

crypto/vm/boc.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,9 @@ td::Result<int> CellSerializationInfo::get_bits(td::Slice cell) const {
8989
// TODO: check usage when result is empty
9090
td::Result<Ref<DataCell>> CellSerializationInfo::create_data_cell(td::Slice cell_slice,
9191
td::Span<Ref<Cell>> refs) const {
92-
CellBuilder cb;
93-
TRY_RESULT(bits, get_bits(cell_slice));
94-
cb.store_bits(cell_slice.ubegin() + data_offset, bits);
9592
DCHECK(refs_cnt == (td::int64)refs.size());
96-
for (int k = 0; k < refs_cnt; k++) {
97-
cb.store_ref(std::move(refs[k]));
98-
}
99-
TRY_RESULT(res, cb.finalize_novm_nothrow(special));
93+
TRY_RESULT(bits, get_bits(cell_slice));
94+
TRY_RESULT(res, DataCell::create(cell_slice.substr(data_offset), bits, refs, special));
10095
CHECK(!res.is_null());
10196
if (res->is_special() != special) {
10297
return td::Status::Error("is_special mismatch");

crypto/vm/cells/CellBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Ref<DataCell> CellBuilder::finalize_copy(bool special) const {
5050
if (vm_state_interface) {
5151
vm_state_interface->register_cell_create();
5252
}
53-
auto res = DataCell::create(data, size(), td::span(refs.data(), size_refs()), special);
53+
auto res = DataCell::create(td::Slice{data, Cell::max_bytes}, size(), td::span(refs.data(), size_refs()), special);
5454
if (res.is_error()) {
5555
LOG(DEBUG) << res.error();
5656
throw CellWriteError{};
@@ -68,7 +68,8 @@ Ref<DataCell> CellBuilder::finalize_copy(bool special) const {
6868
}
6969

7070
td::Result<Ref<DataCell>> CellBuilder::finalize_novm_nothrow(bool special) {
71-
auto res = DataCell::create(data, size(), td::mutable_span(refs.data(), size_refs()), special);
71+
auto res =
72+
DataCell::create(td::Slice{data, Cell::max_bytes}, size(), td::mutable_span(refs.data(), size_refs()), special);
7273
bits = refs_cnt = 0;
7374
return res;
7475
}

0 commit comments

Comments
 (0)