Releases: AntelopeIO/cdt
CDT v3.0.0 Release Notes
Contract Development Toolkit (CDT) is a C/C++ toolchain targeting WebAssembly (WASM) and a set of tools to facilitate development of smart contracts written in C/C++ that are meant to be deployed to an Antelope blockchain.
This release introduces Stack Canary to protect from unexpected results when a smart contract overbounds the stack and a new series of Crypto Extensions to access a set of crypto primitive host functions that smart contract developers can leverage with the C
and C++
API.
Read on for details.
Changes
The change from EOSIO.CDT to CDT may involve several small changes necessary for your project.
- The binaries are no longer prefixed with
eosio
but withcdt
instead, soeosio-cpp
is nowcdt-cpp
, etc. - CMake projects instead of using
find_package(eosio.cdt)
it is now simplyfind_package(cdt)
. - All of the library path and namespaces have remained the same to not cause issues with this release. The next release will more than likely have those names replaced with those files being deprecated but still available to allow for a grace period to transition.
New features
Stack Canary
New stack canary system for large stack size apps. When using the flag -fno-stack-first to allow for large stack sizes to be used, a smart contract developer opens themselves up to spooky behavior occurring, succeeding with unexpected results, or having very severe bugs that cost the project money.
To mitigate this a new option has been added -stack-canary
. This will add some protection to your smart contract so that if the contract does overbound the stack it will fail the contract instead of possibly allowing it to finish with unexpected results.
If this fails it will produce an assertion code of 8000000000000000002
.
Crypto Extensions
PRs
- (mandel.cdt#30) Crypto Extensions
- (21) [3.0] Move new crypto primitives out of crypto.h and crypto.hpp, and add missing ones to the new hpp file
- (30) [3.0] fix duplicate definition of capi_checksum256
A new set of crypto primitive host functions have been added. To allow smart contract developers the ability to leverage these we have added these to the C
API for devs and some of them to the C++
API.
C API now has the functions:
void sha3( const char*, uint32_t, char*, uint32_t , int32_t)
int32_t blake2_f(uint32_t, const char*, uint32_t, const char*, uint32_t, const char*, uint32_t, const char*, uint32_t, int32_t, char* , uint32_t)
int32_t k1_recover( const char*, uint32_t, const char*, uint32_t, char*, uint32_t)
int32_t alt_bn128_add( const char*, uint32_t, const char*, uint32_t, char*, uint32_t)
int32_t alt_bn128_mul( const char*, uint32_t, const char*, uint32_t, char*, uint32_t)
int32_t alt_bn128_pair( const char*, uint32_t)
int32_t mod_exp( const char*, uint32_t, const char*, uint32_t, const char*, uint32_t, char*, uint32_t)
uint32_t get_block_num( void )
The C++ API now has the functions:
eosio::checksum256 sha3(const char*, uint32_t) - this is in crypto.hpp
eosio::checksum256 keccak(const char*, uint32_t) - this in crypto.hpp
void assert_sha3(const char*, uint32_t, eosio::checksum256&) - this is in crypto.hpp
void assert_keccak(const char*, uint32_t, eosio::checksum256&) - this in in crypto.hpp
We have left some of the the C++
API wrappers out in this release as those would be temporary at best and be immediately deprecated.
But the plan is to add those new functions and data types in a future release.
Bug fixes
WASM bloat fix
An issue was introduced in CDT v1.8.x, which resulted in a much larger binary size for the compiled WASM files than those generated by v1.7.x of CDT. The larger WASM files meant increased resource costs when deployed on-chain. This release of CDT now fixes that regression.
Include Ricardian contracts in generated ABIs
Another regression in an old version of CDT caused the compiler to not include Ricardians contracts into the generated ABI files. The fix for that regression is also included in this release.
Nested container feature leading to unknown type error
An unknown type error was being thrown as a result of the nested container feature. is_explicit_nested
determines if a type is nested. It previously counted the number of <s and returns true if the number is greater than 1. This causes problems for types containing std::vector, as std::vector converted to bytes and should not be considered as a vector. An update was made to instead determine nestedness semantically.
Slow deserialization for std::vector<unsigned char>
When deserializing a std::vector of unsigned char it was falling into the generic datastream operator for vectors, making the deserialization of a large array too slow.
Deprecations, removals, and dropped support
kv removal
All references to key value have been removed within this release.
CCache Removal
Because of build issues we have removed the ability to compile CDT with ccache
and sccache
.
Further details on changes since last release
Contributors
Special thanks to the contributors that submitted patches for this release:
- @larryk85
- @linh2931
- @spoonincode
- @arhag
- @766C6164
- @heifner
- @oschwaldp-oci
- @ericpassmore
- @ClaytonCalabrese
- @softprofe
- @ndcgundlach
- @bogniq
- @dimas1185
Full list of changes since last release
PRs
Refer to full list of changes from the following prior releases:
- https://github.com/eosnetworkfoundation/mandel.cdt/releases/tag/v3.0.0-rc1
- https://github.com/AntelopeIO/cdt/releases/tag/v3.0.0-rc2
- https://github.com/AntelopeIO/cdt/releases/tag/v3.0.0-rc3
In addition, this release also includes the following PRs:
Full Changelog: 798162d...v3.0.0
CDT v3.0.0-rc3 Release Notes
This is a RELEASE CANDIDATE for version 3.0.0.
This release contains several bug fixes.
Read on for details.
Changes
The change from EOSIO.CDT to CDT may involve several small changes necessary for your project.
- The binaries are no longer prefixed with
eosio
but withcdt
instead, soeosio-cpp
is nowcdt-cpp
, etc. - CMake projects instead of using
find_package(eosio.cdt)
it is now simplyfind_package(cdt)
. - All of the library path and namespaces have remained the same to not cause issues with this release. The next release will more than likely have those names replaced with those files being deprecated but still available to allow for a grace period to transition.
Bug fixes
Header file location of crypto primitives host functions causing multiple errors
PRs
- (#21) [3.0] Move new crypto primitives out of crypto.h and crypto.hpp, and add missing ones to the new hpp file
The new primitives require a protocol feature to be activated and will otherwise throw errors if they are inside of a header file being used. To avoid unnecessary errors in the future, all primitives have been moved to crypto_ext.h
and crypto_ext.hpp
from crypto.h
and crypto.hpp
respectively to only include them when they are needed.
Nested container feature leading to unknown type error
An unknown type error was being thrown as a result of the nested container feature. is_explicit_nested
determines if a type is nested. It previously counted the number of <s and returns true if the number is greater than 1. This causes problems for types containing std::vector, as std::vector converted to bytes and should not be considered as a vector. An update was made to instead determine nestedness semantically.
Slow deserialization for std::vector
When deserializing a std::vector of unsigned char it was falling into the generic datastream operator for vectors, making the deserialization of a large array too slow.
Further details on changes since last release
Contributors
Special thanks to the contributors that submitted patches for this release:
Full list of changes since last release
PRs
Full Changelog: v3.0.0-rc2...v3.0.0-rc3
CDT v3.0.0-rc2 Release Notes
This is a RELEASE CANDIDATE for version 3.0.0.
This release contains several bug fixes and several changes to support the migration to the AntelopeIO organization. Please note that this release references changes committed in the EOS Network Foundation mandel.cdt repo.
Read on for details.
Changes
The change from EOSIO.CDT to CDT may involve several small changes necessary for your project.
- The binaries are no longer prefixed with
eosio
but withcdt
instead, soeosio-cpp
is nowcdt-cpp
, etc. - CMake projects instead of using
find_package(eosio.cdt)
it is now simplyfind_package(cdt)
. - All of the library path and namespaces have remained the same to not cause issues with this release. The next release will more than likely have those names replaced with those files being deprecated but still available to allow for a grace period to transition.
Bug fixes
WASM bloat fix
An issue was introduced in CDT v1.8.x, which resulted in a much larger binary size for the compiled WASM files than those generated by v1.7.x of CDT. The larger WASM files meant increased resource costs when deployed on-chain. This release of CDT now fixes that regression.
Include Ricardian contracts in generated ABIs
Another regression in an old version of CDT caused the compiler to not include Ricardians contracts into the generated ABI files. The fix for that regression is also included in this release.
Further details on changes since last release
Contributors
Special thanks to the contributors that submitted patches for this release:
- @larryk85
- @softprofe
- @oschwaldp-oci
- @ClaytonCalabrese
- @ndcgundlach
- @bogniq
- @arhag
- @linh2931
- @spoonincode
- @dimas1185
- @766C6164
Full list of changes since last release
PRs
- (mandel.cdt#35) update readme
- (mandel.cdt#36) Backport support stdarray
- (mandel.cdt#40) update head of llvm for fixing wasm bloat
- (mandel.cdt#44) Backport support for nested optional, maps and tuples
- (mandel.cdt#51) Add changes for bug repairs
- (2) Remove mandel references from CDT and update CDT urls
- (3) new CICD based on ENF runners & new platform framework
- (6) Bugfix for ricardian contracts being generated
- (7) [3.0] Antelope rename changes
Full Changelog: dc52e43...v3.0.0-rc2