Releases: EOSIO/eosio.cdt
[CANDIDATE] EOSIO.CDT Version 1.6.0-rc2
This is a RELEASE CANDIDATE for version 1.6.0. The latest STABLE release is v1.5.0.
This release provides several bug fixes to 1.6.0-rc1 and also adds unit/regression tests to eosio.cdt/libraries/eosiolib/
. These changes build on the changes outlined in the Release Candidate 1 (v1.6.0-rc1).
Summary Of Changes
- (#412) Fix codegen for niladic actions.
- (#416) Fix contract::get_datastream() accessor to return a reference to it's
datastream
object. - (#418) A few fixes for eosio::onerror asserting and contracts with no actions defined.
- (#424) Addition of eosiolib unit tests.
- (#419) Changes to fix issue with compiling with the wrong LP64 model.
- (#426) Various small fixes for user experience and more support for
wasm-ql
. - (#427) Fix for mac OS X debug native contract compilation, now supports source level debugging.
- (#439) Renaming of exported functions for
wasm-ql
.
Disclaimer: Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any applications related thereto. We make no representation, warranty, guarantee or undertaking in respect of the releases described herein, the related GitHub release, the EOSIO software or any documentation related to any of the foregoing, whether expressed or implied, and disclaim all liability that may arise from any use of the software or documentation for any purpose. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, resource or service is not an endorsement or recommendation by Block.one.
[CANDIDATE] EOSIO.CDT Version 1.6.0-rc1
eosiolib
- Partitioning of eosiolib into three groups (CAPI, Contracts, and Core), these allow for finer grained allowance for particular modes of compilation. #405
- The
CAPI
will only be available to contract writers usingeosio-cc
and purely forC
smart contracts. - The
Contracts
will be available toeosio-cpp
for smart contract writing. Core
will be available toeosio-cpp
for any of the modes (present and future).eosio-cpp
infnative
mode will have access to all of these groups.
- The
- New simple, small and fast grab-bag malloc is being introduced as the new default malloc. Caveats are that this will not free any memory when calling free (essentially a noop). If your contract needs to free memory because of overrunning malloc'd memory, then passing the flag
use-freeing-malloc
to the compiler you can opt in to using the old implementation. #356 - New data structure
eosio::rope
is introduced in this release. This is a thin data structure for fast string concatenations, this will be more useful forwasm-ql
when it arrives. #356 - Fix off by one error in varint.hpp. #402
new libraries
- Softfloat and compiler-rt are introduced in this release, these can be used with the flag
use-rt
to produce a binary that doesn't import the compiler-rt intrinsics. This is useful for generating WebAssembly that is more self-contained. This will be more useful whenwasm-ql
arrives and future WASM modes are added. #325
tools
eosio-cpp
- Auto generation of dispatcher for smart contracts. #395
- Two new function hooks,
pre_dispatch
andpost_dispatch
have been added for flexibility in control over smart contract dispatching. #395 - New attribute
[[eosio::on_notify]]
to facilitate notification handling. #395 - ABI linking at the link stage of building smart contracts, this now allows for splitting your smart contract into multiple implementation files and still have ABI generation work. #395
- Created system for modal compilation, i.e.
native
,eosio smart contract
,wasm-ql
, and more flavors in the future. #356 - New attribute
[[eosio::wasm_entry]]
is introduced to allow for a naming agnostic way of having an arbitrary WebAssembly entry function wrapped with global constructor and destructor calls. #358 - New attribute
[[eosio::wasm_import]]
is introduced to allow for a more dynamic way of specifying WASM imports then a standalone file. This also allows for different libraries to easily expose their own import API. #358 - Fixes for
eosio-abigen | eosio-cpp
for issues withstd::variant
types, and nestedstd::variant
#399 - Removed timestamp from generated ABI file. #352
eosio-abigen
- This tool is now deprecated because of the "ABI" linking capabilities of
eosio-ld
andeosio-cpp
. In the future useeosio-cpp
with the--abigen
flag, the ABI shouldn't change unless you change your code, so these two should be linked anyway. #377
eosio-ld
- Linkage of ABIs (now held in the object files), to produce the generated ABI. #395
eosio-init
- Fix for invalid project names. #370
Special Thanks
- conr2d
- maoueh
EOSIO.CDT Version 1.5.0
repo
- Using new model for eosio.cdt cmake subsystem for building libraries.
- Added new libraries for native support for native compilation for testing and "scratch pad" compilation for contract developers.
- Updated license year #339
eosiolib
- Added new set of functions (
eosio::check
) to supersede eosio_assert functions #318- overloads to support eosio_assert, eosio_assert_message and eosio_assert_code are supported.
- these new functions should increase performance of smart contracts by not calling the intrinsic unless the test condition fails.
- Removed memory.h #318
- Removed
activate_feature
intrinsic fromprivileged.h
#318 - Resolved issues with
eosio::print
and std::string #318 - Replaced all occurrences of eosio_assert with
eosio::check
#318 - Allow for ""_n to be used to create a zero name (
eosio::name{0}
) #311 - Added c++ guards on system.h #312
- Removed references to nonexistent uint256_t type #333
- Simplified comments for
eosio::multi_index
#328 - Resolved issues with
eosio::print
and integral types #347
nativelib
- Fixed support for checking prints with native testing framework #341
- Added a minimal crt for native contract compilation #317
- Build libc, libcxx, and eosiolib for native linkage #317
- Added framework for setting and getting intrinsics core functions. #317
- In the future libraries can be built to fill in a default implementation of the complex intrinsics. Currently only the eosio_assert*, memcpy/cmp/move, soft float, and print* intrinsics have usable defaults, all others will assert with the message "unsupported intrinsic". Also, only the print* intrinsics can be reset in terms of their default functionality.
- A testing framework for supporting eosio_assert/eosio::check as catchable and the ability to assert in the test or contract code and continue the test forward. #317
- REQUIRE_ASSERT and CHECK_ASSERT function much like BOOST's CHECK_THROW and REQUIRE_THROW, but use the assert message as the predicate instead of an exception type. This checking the assertion message can either be a simple string, which will do a 1 to 1 match of this and the assert message, or you can pass it a lambda that takes a std::string and return a bool so more complex checking can be done.
- CHECK_EQUAL and REQUIRE_EQUAL work almost identically to BOOST's.
- For examples of how to use these see ./tests/unit/system_tests.cpp or ./tests/unit/name_tests.cpp.
- Test registration to support CTest and pretty print which tests pass or fail. #317
- Fixed linkage issues for mac OS X #326
cmake
- A new pattern for cmake use in smart contract development. #291
- This new pattern utilizes the EosioWasmToolchain.cmake as a cmake toolchain file and uses an external cmake project to build the contract code, see the new
eosio-init
tool.
- This new pattern utilizes the EosioWasmToolchain.cmake as a cmake toolchain file and uses an external cmake project to build the contract code, see the new
- To support native builds with
eosio-cpp
two new macrosadd_native_executable
andadd_native_library
, these work identically to cmake'sadd_executable
andadd_library
.
tools
- New tool
eosio-init
is introduced #317- This tool will generate a project for smart contract development, either as a bare eosio-cpp project or cmake project. This tool takes a required project name, an optional path and an optional bare flag.
- The "bare" version will generate a <project name>.hpp, a <project name>.cpp, a <project name>.contracts.md and a readme with how to build the contract.
- The default/non-bare version will create a source tree with the proper cmake files, the above mentioned files in their respective folders, and a readme with instructions of how to build the contract.
- This tool will generate a project for smart contract development, either as a bare eosio-cpp project or cmake project. This tool takes a required project name, an optional path and an optional bare flag.
- Support for native builds with
eosio-cpp/cc
andeosio-ld
#317- this is functionality is exposed with the
fnative
flag for each of the above tools.
- this is functionality is exposed with the
- Fixes for
eosio-abidiff
#298 - Fixes for
eosio-abigen
for yet more nested types #291
[CANDIDATE] EOSIO.CDT Version 1.5.0-rc2
[CANDIDATE] EOSIO.CDT Version 1.5.0-rc1
repo
- Using new model for eosio.cdt cmake subsystem for building libraries.
- Added new libraries for native support for native compilation for testing and "scratch pad" compilation for contract developers.
eosiolib
- Added new set of functions (
eosio::check
) to supersede eosio_assert functions #318- overloads to support eosio_assert, eosio_assert_message and eosio_assert_code are supported.
- these new functions should increase performance of smart contracts by not calling the intrinsic unless the test condition fails.
- Removed memory.h #318
- Removed
activate_feature
intrinsic fromprivileged.h
#318 - Resolved issues with
eosio::print
and std::string #318 - Replaced all occurrences of eosio_assert with
eosio::check
#318 - Allow for ""_n to be used to create a zero name (
eosio::name{0}
) #311 - Added c++ guards on system.h #312
nativelib
- Added a minimal crt for native contract compilation #317
- Build libc, libcxx, and eosiolib for native linkage #317
- Added framework for setting and getting intrinsics core functions. #317
- In the future libraries can be built to fill in a default implementation of the complex intrinsics. Currently only the eosio_assert*, memcpy/cmp/move, soft float, and print* intrinsics have usable defaults, all others will assert with the message "unsupported intrinsic". Also, only the print* intrinsics can be reset in terms of their default functionality.
- A testing framework for supporting eosio_assert/eosio::check as catchable and the ability to assert in the test or contract code and continue the test forward. #317
- REQUIRE_ASSERT and CHECK_ASSERT function much like BOOST's CHECK_THROW and REQUIRE_THROW, but use the assert message as the predicate instead of an exception type. This checking the assertion message can either be a simple string, which will do a 1 to 1 match of this and the assert message, or you can pass it a lambda that takes a std::string and return a bool so more complex checking can be done.
- CHECK_EQUAL and REQUIRE_EQUAL work almost identically to BOOST's.
- For examples of how to use these see ./tests/unit/system_tests.cpp or ./tests/unit/name_tests.cpp.
- Test registration to support CTest and pretty print which tests pass or fail. #317
cmake
- A new pattern for cmake use in smart contract development. #291
- This new pattern utilizes the EosioWasmToolchain.cmake as a cmake toolchain file and uses an external cmake project to build the contract code, see the new
eosio-init
tool.
- This new pattern utilizes the EosioWasmToolchain.cmake as a cmake toolchain file and uses an external cmake project to build the contract code, see the new
- To support native builds with
eosio-cpp
two new macrosadd_native_executable
andadd_native_library
, these work identically to cmake'sadd_executable
andadd_library
.
tools
- New tool
eosio-init
is introduced #317- This tool will generate a project for smart contract development, either as a bare eosio-cpp project or cmake project. This tool takes a required project name, an optional path and an optional bare flag.
- The "bare" version will generate a <project name>.hpp, a <project name>.cpp, a <project name>.contracts.md and a readme with how to build the contract.
- The default/non-bare version will create a source tree with the proper cmake files, the above mentioned files in their respective folders, and a readme with instructions of how to build the contract.
- This tool will generate a project for smart contract development, either as a bare eosio-cpp project or cmake project. This tool takes a required project name, an optional path and an optional bare flag.
- Support for native builds with
eosio-cpp/cc
andeosio-ld
#317- this is functionality is exposed with the
fnative
flag for each of the above tools.
- this is functionality is exposed with the
- Fixes for
eosio-abidiff
#298 - Fixes for
eosio-abigen
for yet more nested types #291
EOSIO.CDT Version 1.4.1 Release Notes
repo
- Removed Remove CMAKE_CXX_STANDARD 17 from EosioWasmToolchain.cmake #267
- This was causing issues for Centos users and for users with low CMake versions
- Added binary builds for Centos
eosiolib
- Force compile time execution of
name
#249 - Fixed regression in
eosio::fixed_key<T>
#255 - Fixed
eosio::multi_index::begin
bug #256
tools
- Fixed symlinks for various installed tools #268
EOSIO.CDT Version 1.4 Release Notes
repo
- Small examples of hello, send_inline and multi_index were added/modified. #247
- Added installation of licenses for binary packages. #238
- Added Dockerfile. #206
eosio-abidiff
- New tool to compare and report changes in ABI structures/names. #229
eosiolib
- New data type
eosio::binary_extension
added. #229. - Serialization support fo
eosio::binary_extension
andstd::variant
added. #229 - New type
eosio::fixed_bytes<T>
and aliaseseosio::checksum160/256/512
added as C++ replacements forcapi_checksum
types. #243 eosio::fixed_key<T>
and by extensioneosio::key256
are deprecated and are replaced byeosio::fixed_bytes<t>
and theeosio::checksum256
alias respectively.- C++ wrappers for the crypto asserts added, (e.g. assert_sha1/256/512). #236
- Various bug fixes #233
- Updated multi_index documentation #226
- New types
eosio::action_wrapper
andeosio::variant_action_wrapper
added for a more simplified and type-safe method to send inline actions. #229
eosio-abigen
- eosio-abigen now produces ABI v1.1, this has been available in
nodeos
since EOS v1.3.x, please note if an ABI serialization library/tool only supports ABI v1.0 this will break compatibility. - Automatic import of ricardian contracts into generated ABI. #207
- Support for non-type templates in ABI generation. #246
- Support for binary_extensions and std::variant added and now switch to producing abi v1.1. #229
- Support for tuple, set, map, std::pair and generic template types for ABI generation. #229
- Various bug fixes #241, #208
eosio-cpp
EOSIO.CDT Version 1.3.2 Release Notes
EOSIO.CDT Version 1.3.1 Release Notes
eosiolib
- symbol.hpp
- Added a
constexpr
constructor to take astd::string_view
(to construct asymbol_code
) and auint8_t
(precision), so instead ofsymbol(symbol_code("SYS"), 4)
, you can usesymbol("SYS", 4)
#150
- Added a
eosio-abigen
- Fixed the issue with unwanted structs not being filtered out #150
- Fixed the issue with C++17 not being used to compile when calling eosio-abigen explicitly #150
libcxx
- Patched locale to allow for compilation of
std::stringstream
,std::regex
. #150 - Added warnings to the headers of
sstream
,regex
,strstream
that indicate that using these types will greatly increase the size of the compiled contract. #150 - Added error for
iostream
, as this conflicts witheosio::datastream
#150
EOSIO.CDT Version 1.3.0 Release Notes
eosiolib C API
- addition of
uint64_t
typedefcapi_name
#132 - removal of
uint64_t
typedefs #132account_name
permission_name
scope_name
table_name
action_name
- these have been replaced by
capi_name
, and as a practice should not be used. The new version of thename
type should be used to replace these instances. This decision was made because of bad implict casting issues withuint64_t
and the new pattern should allow for better type safety.
- these have been replaced by
symbol_name
- this has no C equivalent and is superceded by the
symbol_code
struct. As with the previously mentioned named types, this was removed and replaced withsymbol_code
to allow for better type safety in contracts. To use a symbol, i.e. symbol name and precision, use thesymbol
class.
- this has no C equivalent and is superceded by the
- removal of
time
andweight_type
typedefs #132 - removal of the typedefs
transaction_id_type
andblock_id_type
#132 - removal of the
account_permission
struct #132 - renaming of typedefs #132
checksum160
->capi_checksum160
checksum256
->capi_checksum256
checksum512
->capi_checksum512
public_key
->capi_public_key
signature
->capi_signature
- removal of non-existent intrinsics declarations
require_write_lock
andrequire_read_lock
#132
eosiolib C++ API
- removal of eosiolib/vector.hpp #132
- removed alias
eosio::vector
and typedefbytes
- removed alias
- removal of eosiolib/types.hpp #132
- removal of eosiolib/optional.hpp #136
- removal of eosiolib/core_symbol.hpp #122
- added eosiolib/name.hpp #132
eosiolib/types.hpp
- moved the typedef
eosio::extensions_types
to eosiolib/transaction.hpp #132 - removed comparison functions for
checksum
structs #132 - removal of
eosio::char_to_symbol
,eosio::string_to_name
,eosio::name_suffix
functions #132 - removal of the
N
macro. #132 - moved
eosio::name
struct definition and ""_n operator to eosiolib/name.hpp #132
eosiolib/name.hpp
- removal of implicit and explicit conversions to
uint64_t
. #132 - addition of
enum class
eosio::name::raw
#132 - added
bool
conversion operator for conditionally testing if a name is empty #132 - all constructors are now
constexpr
#132 - added
constexpr
methodseosio::name::length
,eosio::name::suffix
#132 - added equivalence, inverted equivalence and less than operators to
eosio::name
#132
eosiolib/symbol.hpp
- removed
eosio::symbol_type
struct and replaced witheosio::symbol
class #122 - added struct
eosio::symbol_code
#122- added two
constexpr
constructors that take either a rawuint64_t
or anstd::string_view
- added
constexpr
methodsis_valid
,length
andraw
- added a print method
- added
bool
conversion operator to test issymbol_code
is empty
- added two
- removal of
eosio::string_to_symbol
,eosio::is_valid_symbol
,eosio::symbol_name_length
functions #122 - removal of the
S
macro. #122 - added struct
eosio::symbol
#122- added two
constexpr
constructors that take either a rawuint64_t
or asymbol_code
and auint8_t
precision.
- added two
- modified struct
eosio::extended_symbol
#132- restricted fields to private
- added
constexpr
constructor that takes aeosio::symbol
and aneosio::name
. - added
constexpr
methodsget_symbol
andget_contract
. - made existing comparison operators
constexpr
eosiolib/asset.hpp
- The main constructor now requires a
int64_t
(quantity) andeosio::symbol
explicitly. #132
eosiolib/contract.hpp
- The constructor for
eosio::contract
now takes aneosio::name
for the receiver, aneosio::name
for the code, and aeosio::datastream<const char*>
for the datastream used for the contract. The last argument is for manually unpacking an action, see the section oneosio::ignore
for a more indepth usage. #136
eosiolib/dispatcher.hpp
- renamed the macro
EOSIO_ABI
toEOSIO_DISPATCH
, as this makes more sense as to what this macro does. #136 - modified the definition of
EOSIO_DISPATCH
to work with the new constructor foreosio::contract
eosiolib/multi_index.hpp
- the first template parameter for
indexed_by
now requires the argument be convertible toeosio::name::raw
(replacinguint64_t
. #132 - the first template parameter for
multi_index
now requires the argument be convertible toeosio::name::raw
(replacinguint64_t
. #132 - the constructor now takes an
eosio::name
type for the code (replacinguint64_t
), scope is stilluint64_t
. #132 - various other replacements of
uint64_t
toeosio::name
#132
eosiolib/singleton.hpp
- the first template parameter for
eosio::singleton
now requires the argument be convertible toeosio::name::raw
(replacinguint64_t
. #132 - the constructor now takes an
eosio::name
type for the code. #132 - in the methods
get_or_create
andset
the argumentbill_to_account
is now of typeeosio::name
(replacinguint64_t
). #132
eosiolib/action.hpp
- added C++ function
eosio::require_auth
#132 - added C++ function
eosio::has_auth
#132 - added C++ function
eosio::is_account
#132 - redefined
eosio::permission_level
to useeosio::name
in place ofuint64_t
#132 - removed the macro
ACTION
#136
eosiolib/permission.hpp
- The optional provided_keys argument of the function
eosio::check_transaction_authorization
is now of the typestd::set<eosio::public_key>
rather than the typestd::set<capi_public_key>
. #132 - the
account
andpermission
arguments ofeosio::check_transaction_authorization
are botheosio::name
now instead ofuint64_t
#132
eosiolib/ignore.hpp
- added new type
ignore
#133- this type acts as a placeholder for actions that don't want to deserialize their fields but what the types to be reflected in the abi.
ACTION action(ignore<some_type>) { some_type st; _ds >> st; }
- this type acts as a placeholder for actions that don't want to deserialize their fields but what the types to be reflected in the abi.
- added new type
ignore_wrapper
#133- this allows for calling
SEND_INLINE_ACTION
withignore_wrapper(some_value)
against an action with anignore
of matching types.
- this allows for calling
macros
- added
ACTION
macro, this is simply a wrapper for[[eosio::action]] void
#136 - added
TABLE
macro, this is simply a wrapper forstruct [[eosio::table]]
#136 - added
CONTRACT
macro, this is simply a wrapper forclass [[eosio::contract]]
#136
CMake
- added
eosio.cdt-config.cmake
to allow forfind_package(eosio.cdt)
#105 - added new macro
add_contract
#136 - new version checking mechanism is included, see eosio.contracts/CMakeLists.txt to see this in use. #111
libc
- replaced
printf
,sprintf
, andsnprintf
with new minimal variants, and allows contracts to use these functions without causing stack overflow issues. #142
libcxx
- removed
sstream
, with the intent to return this after more has been done. #142 - added
__cxa_pure_virtual
to allow for pure virtual methods in contract classes. #142 std::to_string
now works without the issues of stack overflows. #142
attributes
- added
[[eosio::ignore]]
attribute to flag a type as being ignored by the deserializer, this attribute is primarily only used for internal use within eosiolib. #133 - added
[[eosio::contract]]
attribute #133
boost
- is now part of the library (Boost will be removed in a future release), no more external dependence on Boost and all system inclusion are within it's
sysroot
. #105
eosio-cpp
- bumped the default standard to C++17 #133
eosio-abigen
- various fixes for vector, optional, stalling. Produces accurate abis for eosio.contracts.