From e10c4fbfbe880504357d7ea6ac4a6d62bbc6de32 Mon Sep 17 00:00:00 2001
From: Daniel Drasovean <daniel.drasovean@multiversx.com>
Date: Tue, 25 Jun 2024 17:01:28 +0300
Subject: [PATCH 1/4] Fix keygenerator Dockerfile

---
 docker/keygenerator/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docker/keygenerator/Dockerfile b/docker/keygenerator/Dockerfile
index c66a732e629..5d79327bc2a 100644
--- a/docker/keygenerator/Dockerfile
+++ b/docker/keygenerator/Dockerfile
@@ -13,4 +13,4 @@ FROM ubuntu:22.04
 COPY --from=builder /go/mx-chain-go/cmd/keygenerator /go/mx-chain-go/cmd/keygenerator
 
 WORKDIR /go/mx-chain-go/cmd/keygenerator/
-ENTRYPOINT ["./keygenerator"]
+ENTRYPOINT ["/go/mx-chain-go/cmd/keygenerator/keygenerator"]

From cfb556884c537b662b98f942155f1e5da4b20e86 Mon Sep 17 00:00:00 2001
From: Daniel Drasovean <daniel.drasovean@multiversx.com>
Date: Wed, 26 Jun 2024 13:38:01 +0300
Subject: [PATCH 2/4] Remove redundant code

---
 docker/keygenerator/Dockerfile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/docker/keygenerator/Dockerfile b/docker/keygenerator/Dockerfile
index 5d79327bc2a..a73d7951d42 100644
--- a/docker/keygenerator/Dockerfile
+++ b/docker/keygenerator/Dockerfile
@@ -12,5 +12,4 @@ RUN go build
 FROM ubuntu:22.04
 COPY --from=builder /go/mx-chain-go/cmd/keygenerator /go/mx-chain-go/cmd/keygenerator
 
-WORKDIR /go/mx-chain-go/cmd/keygenerator/
 ENTRYPOINT ["/go/mx-chain-go/cmd/keygenerator/keygenerator"]

From a5d15092412e7411a5dff77ef149d9f03f5d3350 Mon Sep 17 00:00:00 2001
From: Daniel Drasovean <daniel.drasovean@multiversx.com>
Date: Wed, 26 Jun 2024 13:41:24 +0300
Subject: [PATCH 3/4] Updated to support multi-arch docker builds

---
 docker/node/Dockerfile   | 14 ++++++++++----
 docker/termui/Dockerfile |  9 +++++++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile
index 2513f789dc8..81675a6f6a3 100644
--- a/docker/node/Dockerfile
+++ b/docker/node/Dockerfile
@@ -7,15 +7,21 @@ RUN go mod tidy
 # Multiversx node
 WORKDIR /go/mx-chain-go/cmd/node
 RUN go build -v -ldflags="-X main.appVersion=$(git describe --tags --long --dirty)"
-RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib/libwasmer_linux_amd64.so
-RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer2/libvmexeccapi.so /lib/libvmexeccapi.so
+
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib_amd64/
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer2/libvmexeccapi.so /lib_amd64/
+
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer/libwasmer_linux_arm64_shim.so /lib_arm64/
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-go | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer2/libvmexeccapi_arm.so /lib_arm64/
 
 # ===== SECOND STAGE ======
 FROM ubuntu:22.04
 RUN apt-get update && apt-get upgrade -y
 COPY --from=builder "/go/mx-chain-go/cmd/node/node" "/go/mx-chain-go/cmd/node/"
-COPY --from=builder "/lib/libwasmer_linux_amd64.so" "/lib/libwasmer_linux_amd64.so"
-COPY --from=builder "/lib/libvmexeccapi.so" "/lib/libvmexeccapi.so"
+
+# Copy architecture-specific files
+COPY --from=builder "/lib_${TARGETARCH}/*" "/lib/"
+
 WORKDIR /go/mx-chain-go/cmd/node/
 EXPOSE 8080
 ENTRYPOINT ["/go/mx-chain-go/cmd/node/node"]
diff --git a/docker/termui/Dockerfile b/docker/termui/Dockerfile
index bcc670e3ce3..e25e75833e5 100644
--- a/docker/termui/Dockerfile
+++ b/docker/termui/Dockerfile
@@ -4,11 +4,16 @@ WORKDIR /go/mx-chain-go
 COPY . .
 WORKDIR /go/mx-chain-go/cmd/termui
 RUN go build -v
-RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib/libwasmer_linux_amd64.so
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1| awk -F '/' '{print$3}'| sed 's/ /@/g')/wasmer/libwasmer_linux_amd64.so /lib_amd64/
+RUN cp /go/pkg/mod/github.com/multiversx/$(cat /go/mx-chain-go/go.mod | grep mx-chain-vm-v | sort -n | tail -n -1 | awk -F '/' '{print$3}' | sed 's/ /@/g')/wasmer/libwasmer_linux_arm64_shim.so /lib_arm64/
+
 
 # ===== SECOND STAGE ======
 FROM ubuntu:22.04
 COPY --from=builder /go/mx-chain-go/cmd/termui /go/mx-chain-go/cmd/termui
-COPY --from=builder "/lib/libwasmer_linux_amd64.so" "/lib/libwasmer_linux_amd64.so"
+
+# Copy architecture-specific files
+COPY --from=builder "/lib_${TARGETARCH}/*" "/lib/"
+
 WORKDIR /go/mx-chain-go/cmd/termui/
 ENTRYPOINT ["./termui"]

From 768ec0db4f5e1b73f88314d20356189791d22507 Mon Sep 17 00:00:00 2001
From: Sorin Stanculeanu <sorinstanculeanu26@gmail.com>
Date: Thu, 25 Jul 2024 10:43:34 +0300
Subject: [PATCH 4/4] updated deps after merge

---
 go.mod | 24 ++++++++++++------------
 go.sum | 48 ++++++++++++++++++++++++------------------------
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/go.mod b/go.mod
index 9ce7b739da6..140e76d10c8 100644
--- a/go.mod
+++ b/go.mod
@@ -14,18 +14,18 @@ require (
 	github.com/gorilla/websocket v1.5.0
 	github.com/klauspost/cpuid/v2 v2.2.5
 	github.com/mitchellh/mapstructure v1.5.0
-	github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e
-	github.com/multiversx/mx-chain-core-go v1.2.21-0.20240703140829-626328c91a8d
-	github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240508074452-cc21c1b505df
-	github.com/multiversx/mx-chain-es-indexer-go v1.7.2-0.20240716122746-98808ec1d4da
-	github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57
-	github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00
-	github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f
-	github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240718081121-561b61a8f07f
-	github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240716073310-c7de86535df1
-	github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b
-	github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240509104009-598a37ff36b9
-	github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240509104102-2a6a709b4041
+	github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240725071304-ebce652ff65d
+	github.com/multiversx/mx-chain-core-go v1.2.21-0.20240725065431-6e9bfee5a4c6
+	github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f
+	github.com/multiversx/mx-chain-es-indexer-go v1.7.3-0.20240725073933-b3457c5308ca
+	github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775
+	github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6
+	github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf
+	github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087
+	github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240725073737-3f682a6c59db
+	github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240725073104-85ec99cb9260
+	github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240725073322-952f3197e2e2
+	github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240725073616-3b96f06509cf
 	github.com/pelletier/go-toml v1.9.3
 	github.com/pkg/errors v0.9.1
 	github.com/prometheus/client_golang v1.14.0
diff --git a/go.sum b/go.sum
index 40dea7a6a6e..1522bc6a3e5 100644
--- a/go.sum
+++ b/go.sum
@@ -385,30 +385,30 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n
 github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
 github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUYwbO0993uPI=
 github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
-github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e h1:Tsmwhu+UleE+l3buPuqXSKTqfu5FbPmzQ4MjMoUvCWA=
-github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e/go.mod h1:2yXl18wUbuV3cRZr7VHxM1xo73kTaC1WUcu2kx8R034=
-github.com/multiversx/mx-chain-core-go v1.2.21-0.20240703140829-626328c91a8d h1:2x1arnxYt28ZlDAZj61dzmG4NqoUmAZbe3pTFsBZHek=
-github.com/multiversx/mx-chain-core-go v1.2.21-0.20240703140829-626328c91a8d/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
-github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240508074452-cc21c1b505df h1:clihfi78bMEOWk/qw6WA4uQbCM2e2NGliqswLAvw19k=
-github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240508074452-cc21c1b505df/go.mod h1:gtJYB4rR21KBSqJlazn+2z6f9gFSqQP3KvAgL7Qgxw4=
-github.com/multiversx/mx-chain-es-indexer-go v1.7.2-0.20240716122746-98808ec1d4da h1:PRJLylGD/RRJg3kVc38YJDeAkDBqzXL2B1a+TLQGrYw=
-github.com/multiversx/mx-chain-es-indexer-go v1.7.2-0.20240716122746-98808ec1d4da/go.mod h1:rEQ0HPBp0Rg7in8TrC+vncV03yyWWTSTur2sbVGUtUw=
-github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57 h1:g9t410dqjcb7UUptbVd/H6Ua12sEzWU4v7VplyNvRZ0=
-github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57/go.mod h1:cY6CIXpndW5g5PTPn4WzPwka/UBEf+mgw+PSY5pHGAU=
-github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00 h1:hFEcbGBtXu8UyB9BMhmAIH2R8BtV/NOq/rsxespLCN8=
-github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00/go.mod h1:pnIIfWopbDMQ1EW5Ddc6KDMqv8Qtx+hxbH9rorHpCyo=
-github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f h1:yd/G8iPBGOEAwbaS8zndJpO6bQk7Tk72ZhmlqRasThI=
-github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f/go.mod h1:E6nfj9EQzGxWDGM3Dn6eZWRC3qFy1G8IqOsYsBOcgWw=
-github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240718081121-561b61a8f07f h1:YSq5I39Rqd1gm2mR40qzlBo/6HP7Eb2MZ+jUkmhn2mw=
-github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240718081121-561b61a8f07f/go.mod h1:RgGmPei0suQcFTHfO4cS5dxJSiokp2SM5lmNgp1icMo=
-github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240716073310-c7de86535df1 h1:iEF9yjTDl/WSvHHi+1hU84NCC7ZprSHDI9W68ruJ8BQ=
-github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240716073310-c7de86535df1/go.mod h1:AKygEQlZe9F2YdO8VKK8QCWb7UTCuN2KclFcEfFo0m4=
-github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b h1:puYO0lUyPGA5kZqsiDjGa+daDGQwj9xFs0S5urhZjU8=
-github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b/go.mod h1:SY95hGdAIc8YCGb4uNSy1ux8V8qQbF1ReZJDwQ6AqEo=
-github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240509104009-598a37ff36b9 h1:rrkgAS58jRXc6LThPHY5fm3AnFoUa0VUiYkH5czdlYg=
-github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240509104009-598a37ff36b9/go.mod h1:TiOTsz2kxHadU0It7okOwcynyNPePXzjyl7lnpGLlUQ=
-github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240509104102-2a6a709b4041 h1:k0xkmCrJiQzsWk4ZM3oNQ31lheiDvd1qQnNwnyuZzXU=
-github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240509104102-2a6a709b4041/go.mod h1:XeZNaDMV0hbDlm3JtW0Hj3mCWKaB/XecQlCzEjiK5L8=
+github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240725071304-ebce652ff65d h1:grQCJW4DCvvIQ6q84sy23oAp8XQ8Dxr3Js8aoh+m99M=
+github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240725071304-ebce652ff65d/go.mod h1:hFGM+O7rt+gWXSHFoRjC3/oN0OJfPfeFAxqXIac5UdQ=
+github.com/multiversx/mx-chain-core-go v1.2.21-0.20240725065431-6e9bfee5a4c6 h1:Q7uUjTYTrt8Mw9oq5JWPv+WHhpxHTv6lhZZlhPuNcoQ=
+github.com/multiversx/mx-chain-core-go v1.2.21-0.20240725065431-6e9bfee5a4c6/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
+github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f h1:jydjrmVFvSllBOTppveOAkLITpOYKk0kma5z0bfDImI=
+github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f/go.mod h1:9aSp//uBSvqFdzh4gvYISraoruhr1FCTXgPQalQ687k=
+github.com/multiversx/mx-chain-es-indexer-go v1.7.3-0.20240725073933-b3457c5308ca h1:9b2yFAarWDG/jTYePv0UqNWQ9gxeSZy9mGxtd8dFj2Y=
+github.com/multiversx/mx-chain-es-indexer-go v1.7.3-0.20240725073933-b3457c5308ca/go.mod h1:bHPP5zerhmbRfVcbfXgpMPUaTKMrK6gGi+rRbw0BpDE=
+github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775 h1:a8LOfz3p4MQfRtbF00rGDAJiebziwtSfVmBHIaHBDdY=
+github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240725065747-176bd697c775/go.mod h1:owPYyrK7RcsLx9eOCAZQ22fIyW6BE7ttJr4XIhFIbQw=
+github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6 h1:QGQjSlPix5nBtCkcdyKo0b2sRYXwYF/GBtccOqDbU6Y=
+github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240725072925-89c927c8b6a6/go.mod h1:MvJiMtuyGq43aS9eOgF+xQUWk0hYxvCQqLrT77bhBaE=
+github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf h1:L9K7Xzq5SZz6k55R7HrafiRcU+c8/PqozJxys65G4bI=
+github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf/go.mod h1:ptvW/8r6bam55mVpeVZbyvvvydYM0DQwcPOH0W4Xyx8=
+github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087 h1:ovxs8X50iBL9TOkn0qHrkuXrBS1Y/EWfQOYmFEaXRNs=
+github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240725072715-8806f1301087/go.mod h1:nNGN+rdLRN8Nd6OhFGrkEZS5Ipj5IQCvFT0L/iQbOpU=
+github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240725073737-3f682a6c59db h1:ZSvHaMsoL0hNfaVBsBZskUdMEaKu+Fdrx3KZrSBbkio=
+github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240725073737-3f682a6c59db/go.mod h1:CFOSVrsHOzaO5YX2L/wyjP76L+BE/9rh+SereQV3pHA=
+github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240725073104-85ec99cb9260 h1:Ny3s7dw2oF6AVq4kZYmhNYWvAuLEbd48JPPIC6tFzOA=
+github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240725073104-85ec99cb9260/go.mod h1:NFRX6UrkBMb28HFKZyKwH894uxfrZyfuFqMF1KBVqFw=
+github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240725073322-952f3197e2e2 h1:TM45+UXZV5DYOHlbGiHyQm44hOlBid8g9qfvYqopILs=
+github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240725073322-952f3197e2e2/go.mod h1:Ntfq9tUV3I5k6SS/OpW4HSO6AlZbs/xxgB2poOuc2pg=
+github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240725073616-3b96f06509cf h1:axwaSswcaw8pituLVAu4IWlGNtYwXvUMYy+MGPwmxuY=
+github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240725073616-3b96f06509cf/go.mod h1:2TjMTiVFkh5wFImEEFZl+k5MU8bh2287btJuVCR3sL0=
 github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
 github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM=
 github.com/multiversx/protobuf v1.3.2 h1:RaNkxvGTGbA0lMcnHAN24qE1G1i+Xs5yHA6MDvQ4mSM=