当前位置: 首页区块链正文 2021.06 Substrate 技术更新速递 ## 重要提交和发布 * [GRANDPA: 加强了grandpa gossip的限制](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9131) – 可以减少当前网络中的相关消息,并且让gossip的机制更加的公平。 * [将SelectChain从同步变成异步接口](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9128) – 从而在接口实现中可以异步地读取一些子系统的信息。 * ef="[https://github.com/paritytech/substrate/pull/9106](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9106)">存储项的 remove_all等 API 添加了删除元素数量的限制 – 当集合类元素数量很多时,可以通过给定这一限制,分批次删除数据,影响的 API 有`remove_all, remove_prefix, clear_prefix, kill_prefix`。 * [增大wasm字节码可获取的内存大小限制至32MB](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9102) – Substrate实现了freeing-bump 内存分配器,可以动态的在一定范围分配内存,最新修改为32MB,用以解决staking模块占用内存过大的问题。 * [强制FRAME v2中可调用函数需要声明为 pub](https://link.zhihu.com/?target=https%3A//githu%3Ccode%3Eb.c%3C/code%3Eom/paritytech/substrate/pull/9085) – 从而更加符合rust语法。 * [为编译后二进制包提供的 try-runtime 命令添加了execute-block子命令](https://link.zhihu.com/?target=htt%3Ccode%3Eps%3A//github%3C/code%3E.com/p%3Ccode%3Earitytech/sub%3C/code%3Estrate/pull/9077) – 用户可以使用此命令在上一个区块的 runtime 状态的基础上执行提供的区块。 * href="[https://github.com/paritytech/substrate/pull/9050](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9050)">允许#[pallet::constant]宏作用于有多个接口约束的关联类型 – 即支持以下语法, `#[pallet::constant] type U: Get<u32> + From<u16>;` * [内置的balances模块新增 transfer_all 可调用函数](https://github.com/paritytech/substrate/pull/9018) – 用来将所有的可用余额转出至另外一个账户。 * [允许对存储项的前缀即 prefix 重命名](https://link.zhihu.com/?target=https%3A//github.com/paritytech/substrate/pull/9016) – 默认使用的存储项定义时的字符串字面量,新标签`#[pallet::storage_prefix = "CustomName"]`可以将prefix自定义。 * [抽象了声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。 收藏 海报 链接