Skip to content

Releases: AntelopeIO/cdt

CDT v3.0.0 Release Notes

08 Sep 19:39
ca04970
Compare
Choose a tag to compare

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 with cdt instead, so eosio-cpp is now cdt-cpp, etc.
  • CMake projects instead of using find_package(eosio.cdt) it is now simply find_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

PRs

  • (mandel.cdt#5) Adding Stack canary support for safe large stack usages.


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

PRs


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

PRs

  • (6) Bugfix for ricardian contracts being generated


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

PRs

  • (23) [3.0] fix is_explicit_nested in abi generator gen.hpp


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>

PRs

  • (27) Optimize datastream for vector of primitive types


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:

Full list of changes since last release

PRs

Refer to full list of changes from the following prior releases:

In addition, this release also includes the following PRs:

  • (30) [3.0] fix duplicate definition of capi_checksum256
  • (32) [3.0] Bump CDT version to 3.0.0


Full Changelog: 798162d...v3.0.0

CDT v3.0.0-rc3 Release Notes

30 Aug 22:23
3309250
Compare
Choose a tag to compare
Pre-release

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 with cdt instead, so eosio-cpp is now cdt-cpp, etc.
  • CMake projects instead of using find_package(eosio.cdt) it is now simply find_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

PRs

  • (#23) [3.0] fix is_explicit_nested in abi generator gen.hpp


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

PRs

  • (#27) Optimize datastream for vector of primitive types


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

  • (#21) [3.0] Move new crypto primitives out of crypto.h and crypto.hpp, and add missing ones to the new hpp file
  • (#23) [3.0] fix is_explicit_nested in abi generator gen.hpp
  • (#27) Optimize datastream for vector of primitive types


Full Changelog: v3.0.0-rc2...v3.0.0-rc3

CDT v3.0.0-rc2 Release Notes

17 Aug 14:53
8e6a501
Compare
Choose a tag to compare
Pre-release

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 with cdt instead, so eosio-cpp is now cdt-cpp, etc.
  • CMake projects instead of using find_package(eosio.cdt) it is now simply find_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

PRs


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

PRs

  • (6) Bugfix for ricardian contracts being generated


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:

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