From c4c883c1fbf47f656b3a923f0e446553718791a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Novo?= <34069419+TeknoPT@users.noreply.github.com> Date: Wed, 11 Oct 2023 16:59:34 +0100 Subject: [PATCH 1/2] Fix's to the docker files and the ABCI. - Fix DockerFiles - Fix ABCI Connector issue if the block was null . --- DOCKER/DockerfileTestnet | 3 +-- DOCKER/DockerfileTestnetDebug | 1 - Phantasma.Node/src/ABCIConnector.cs | 34 +++++++++++++++++------------ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/DOCKER/DockerfileTestnet b/DOCKER/DockerfileTestnet index 21d39c31..225add70 100644 --- a/DOCKER/DockerfileTestnet +++ b/DOCKER/DockerfileTestnet @@ -9,8 +9,7 @@ COPY DOCKER/bin /app/bin RUN apt-get update; apt-get install -y inotify-tools libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev libc6-dev libicu-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev librocksdb-dev libc6-dev libsnappy-dev libicu-dev screen bash vim net-tools ca-certificates openssl libssl-dev libgdiplus libx11-dev nano -#EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357 -EXPOSE 7078 7079 7080 26156 26256 26356 26157 26257 26357 +EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357 RUN chmod +x /app/wrapper-testnet.sh ENTRYPOINT ["/app/wrapper-testnet.sh"] diff --git a/DOCKER/DockerfileTestnetDebug b/DOCKER/DockerfileTestnetDebug index 18490825..979ead13 100644 --- a/DOCKER/DockerfileTestnetDebug +++ b/DOCKER/DockerfileTestnetDebug @@ -8,7 +8,6 @@ COPY DOCKER/bin /app/bin RUN apt-get update; apt-get install -y libc6-dev libsnappy-dev libicu-dev screen bash vim net-tools ca-certificates openssl libssl-dev librocksdb-dev nano -#EXPOSE 7077 7078 7079 7080 26056 26156 26256 26356 26057 26157 26257 26357 EXPOSE 7078 7079 7080 26156 26256 26356 26157 26257 26357 RUN chmod +x /app/wrapper-testnet-debug.sh diff --git a/Phantasma.Node/src/ABCIConnector.cs b/Phantasma.Node/src/ABCIConnector.cs index c3784b3b..ee416def 100644 --- a/Phantasma.Node/src/ABCIConnector.cs +++ b/Phantasma.Node/src/ABCIConnector.cs @@ -293,27 +293,33 @@ public override Task Commit(RequestCommit request, ServerCallCon Log.Information($"ABCI Connector - Commit"); var chain = _nexus.RootChain as Chain; + var attempts = 2; // Is signed by me and I am the proposer - if ( chain.CurrentBlock != null) - Log.Information("Block {Height} is signed by {Address}", chain.Height, chain.CurrentBlock.Validator); - - if (chain.CurrentBlock.Validator == chain.ValidatorAddress) - { - Log.Information("Block {Height} Is Being Validated by me."); - chain.Commit(); - } - else + if (chain.CurrentBlock != null) { - var attempts = 2; - while (chain.CurrentBlock != null && attempts-- > 0) + Log.Information("Block {Height} is signed by {Address}", chain.Height, chain.CurrentBlock.Validator); + if (chain.CurrentBlock.Validator == chain.ValidatorAddress) + { + Log.Information("Block {Height} Is Being Validated by me."); + chain.Commit(); + } + else { - AttemptRequestBlock(chain); + while (chain.CurrentBlock != null && attempts-- > 0) + { + AttemptRequestBlock(chain); - Thread.Sleep(_delayRequests); + Thread.Sleep(_delayRequests); + } + //var data = chain.Commit(); } - //var data = chain.Commit(); } + else + { + Log.Error("Block {Height} Is Null.", chain.Height); + } + var response = new ResponseCommit(); //response.Data = ByteString.CopyFrom(data); // this would change the app hash, we don't want that From e028b81be05d3bede69704b2fb9c15adaddbf724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Novo?= <34069419+TeknoPT@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:27:50 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 606d4ee2..ebff5a00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,34 @@ # Phantasma Blockchain Changelog All notable changes to this project will be documented in this file. +## Version 17 - 12 October, 2023 +### Added + +### Changed + +### Fixed + +## Version 16 - 12 October, 2023 +### Added +- Added `docker-compose.yml` file to run the Phantasma Blockchain in a Docker container. +- Added `docker-entrypoint.sh` file to run the Phantasma Blockchain in a Docker container. +- Added `DockerfileTestnetDebug` file to help debug the Phantasma Blockchain in a Docker container. +- Added `DockerfileTestnetNodeBuilder` file to run the Phantasma Blockchain in a Docker container. +- Added `DockerfileNodeWin` file to build the Phantasma Blockchain. +- Added `wrapper-testnet-debug.sh` file to help debug the Phantasma Blockchain in a Docker container. +- Added a way to provide the `config.json` file as a parameter on startup. + +### Changed +- Bumped version to 16. +- Upgrade to Simnet to increase the amount of SOUL and KCAL the user receives (Development only). +- Updated `Readme.md` file to include instructions on how to debug the Phantasma Blockchain. +- Updated `ABCIConnector.cs` file to check the CurrentBlock is null. + +### Fixed +- Bug fixes to the ConsensusContract. +- Changed `Oracle.cs` to access directly the storage. +- Fixed `NexusValidator.cs` to get the validators from the storage. + ## Version 15 - March 30, 2023 ### Added