今天的開源報報( 每週一到週五 早上 7:00 準時發刊 )
✅ 使用 Rust 從頭開始開發一個 DNS 伺服器教學
✅ 無須與 Google 服務整合的 Chromium 瀏覽器
✅ 偵測資料庫管理系統( DBMS )中的邏輯臭蟲
✅ 一個人性化和快速的 cut 和 awk 替代工具
✅ 使用 Go 建構的書籤管理工具
✅ IDA 和 VS Code 的整合,可以輕鬆地執行和除錯 IDAPython Scripts
✅ 使用簡單的 YAML 語法並利用 GraphViz 生成高階微服務架構圖
✅ SpringBoot 相關漏洞學習資料,利用方法和技巧合集,黑盒安全評估檢查列表
✅ Vue 表單建構器
✅ 定量金融分析的程式庫、軟體套件資源列表
✅ 一個針對網路使用者的 Linux 函式追蹤程式
✅ 使用 C# SDL 和 OpenGL 編寫的紅色警戒開放原始碼遊戲
https://softnshare.com/opensource-news-142/
同時也有1部Youtube影片,追蹤數超過15萬的網紅pennyccw,也在其Youtube影片中提到,Allen Iverson refused to let the Philadelphia 76ers' season end. Iverson scored 13 of his 42 points in the fourth quarter as the defending Eastern...
「rust vs go」的推薦目錄:
- 關於rust vs go 在 軟體開發學習資訊分享 Facebook 的最佳貼文
- 關於rust vs go 在 Taipei Ethereum Meetup Facebook 的最讚貼文
- 關於rust vs go 在 pennyccw Youtube 的最讚貼文
- 關於rust vs go 在 Go vs Rust garbage collector performance and type - Stack ... 的評價
- 關於rust vs go 在 What is Rust and why is it so popular? - Stack Overflow Blog 的評價
- 關於rust vs go 在 How are Rust Traits different from Go Interfaces? - Software ... 的評價
rust vs go 在 Taipei Ethereum Meetup Facebook 的最讚貼文
📜 [專欄新文章] The next generation Ethereum Virtual Machine — Ewasm VM
✍️ Peter Lai
📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium
The next generation Ethereum Virtual Machine — Ewasm VM
The next generation Ethereum Virtual Machine — Crosslink 2019 Taiwan
這篇文章是 Crosslink 2019 Taiwan 的一個議程紀錄:The next generation Ethereum Virtual Machine,由來自 Second State 的工程部 VP Hung-Ying Tai 分享 Ewasm VM 目前研究內容及未來的方向,內容非常精彩,包含了 EVM bytecode 、 Webassembly、Ewasm1.0 以及 Ewasm2.0 。
EVM bytecode 及 Webassembly(WASM)
以太坊的智能合約交易在執行時,例如 :轉 Token 到別的地址,我們是將 EVM bytecode 讀進以太坊的虛擬機執行,而 EVM bytecode 有以下幾點特色:
256 位元且堆疊式(staked-based)的虛擬機
很多高階的指令,例如:SSTORE, SLOAD, SHA3, EC, Call/Create contract
與實體系統架構(通常是 32/64 位元)有差異,而 256 位元則需要靠模擬來完成
較少程式語言(Vyper, Solidity, …)
Webassembly(WASM)是為了讓不同程式語言開發的套件都能在瀏覽器使用的一種二進位程式語言,WASM 有以下幾點特色:
堆疊式(staked-based)的虛擬機:有獨立的區域空間(暫存器或是記憶體),存取堆疊前 3 個物件(EVM 存取 16 個)
支持 32 / 64 位元的操作
沒有高階的指令
RISC 指令集也可以對應到 CPU ISA
較大的社群:主流的瀏覽器都支援,也有較多的程式語言(C++, Rust, GO, …)
Ewasm 1.0
接下來看看以太坊 Ewasm 的特性:
Ewasm 是 wasm 的子集合
因為不能有誤差,所以不支援浮點數運算
只能 import 以太坊的函式庫,避免 importㄒ系統函式庫
在每段指令之前插入 useGAS 來計算 GAS 的花費
Ethereum Environment Interface
EVM 裡有很多像是 SSLOAD, SHA3 的高階指令,這些指令在 Ewasm 1.0 裡,因為 WASM 可以動態讀取函式庫(模組),以太坊定義了 Ethereum Environment Interface 讓客戶端可以用不同的語言實作相對應的函示庫,而且也更容易完成 prototype 跟升級。
下圖是 Ethereum Environment Interface 定義的函數列表。
Ethereum Environment Interface Definition.
如何移除非法的指令?
Ewasm 使用 system contract 移除非法指令以及加入 useGas 的 bytecode,像是浮點數或是非法的 import,有以下兩種做法:
使用 smart contract 檢查合約的 bytecode
像目前的 precompiles 運行在客戶端上,在部署前先檢查合約
下圖是 Ewasm 1.0 的 stack,在部署合約前 Ewasm bytecode 會先經過 Sentinal 的檢查,成功部署後客戶端如果要執行合約會透過 EVM-C 跟 Heru(Wasm Engine)溝通。
Ewasm Stack
效能問題
究竟使用 Ewasm 效能真的會比較快嗎?講者分享各 EVM 執行 Sha1 以及 BN128mul 的結果,可以發現 EVM 在運行 BN128mul 時會是最快,主要是因為 WASM 支持 32 / 64 位元的操作,256 位元則需要另外模擬(1 個 256 位元的運算可以換成 25 個 64 位元的運算),所以 WASM 在跑 BN128mul 時才會比較慢。
Ewasm 2.0
Ewasm 2.0 的智能合約改叫 Execution Environments(EE),與 Ewasm 1.0 不一樣的有下列幾點
EE 全部都是 WASM 寫的
因為支援 cross shard,每個 EE 都是在一個 shard 上執行
EE 只能拿到 state root,而在合約的執行寫法也跟原來不一樣
EE 是 stateless
下圖可以看到 ERC20 Token 在 Ewasm 2.0 跟 Ewasm 1.0 storage 的比較,Ewasm 1.0 每個 data 都會有相對應的 key,而 Ewasm 2.0 只有存 state root,所以只能跟 state root 互動。
Ewasm 2.0 vs Ewasm 1.0
Phase One and Done
目前 Ewasm 2.0 到 phase one and done 的階段,也有測試的網路可以在 shard block 執行 EE,以太坊也有開源 Ewasm 2.0 的測試工具 Scout。
Hello World for Ewasm 2.0
上圖是 Eth 2 的 Hello World EE,可以看到 main 函數裡第一行讀取 pre state root,接下來驗證 block data size 是不是為 0,最後再將 state root 存回去,Eth 2 的智能合約寫起來都會像這樣。
結論
Ewasm 1.0 目前已經支援 EVM 1 大部分的功能也有測試鏈了,second state 開發一個編譯器 soll,能將 solidity 編譯成 Ewasm,想研究的人可以參考看看。
Ewasm 2.0 目前還在研究中,下圖是講者給大家分享的研究及貢獻的方向。
A MAYBE Roadmap
參考
Crosslink 簡報
webassembly.org
scout
soll
Ewasm overview and the precompile problem: Alex Beregszaszi and Casey Detrio @ Ethereum \\ Part 1 — YouTube
Ewasm overview and the precompile problem: Alex Beregszaszi and Casey Detrio @ Ethereum \\ Part 2 — YouTube
Wasm for blockchain&Eth2 execution: Paul Dworzanski,Alex Beregszaszi,Casey Detrio@Ethereum \\ Part 2 — YouTube
Ewasm for sharding
Ewasm updates
Ewasm design
wasm-intro
The next generation Ethereum Virtual Machine — Ewasm VM was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.
👏 歡迎轉載分享鼓掌
rust vs go 在 pennyccw Youtube 的最讚貼文
Allen Iverson refused to let the Philadelphia 76ers' season end.
Iverson scored 13 of his 42 points in the fourth quarter as the defending Eastern Conference champions avoided elimination with a tense 108-103 victory over the Boston Celtics in Game 3 of their first-round series.
The Sixers avoided a best-of-five series sweep for the first time since 1991 against Milwaukee. They host Game 4 on Wednesday.
Responding in pressure situations is nothing new for Iverson.
"That's my life," Iverson said. "That's just what I've been going through since I've been in the league, so I'm kind of used to it. When we lose, people are going to point the finger at me and coach. And when we win gaems, I get the praise. You just accept that and understand that's the way it's going to be."
It was the eighth time Iverson scored at least 40 points in a playoff game. The Sixers are 7-1 in those contests.
"We have another chance to play and we have to put pressure on them, where they feel it," Sixers coach Larry Brown said. "It doesn't look to me like they're feeling it. They're playing with a lot of poise and have a lot to be proud of."
Philadelphia also got a big game from Eric Snow, who scored 23 points. After going a combined 4-of-25 in the first two games of the series, he made 9-of-14 shots in Game 3 and scored six straight points for the Sixers during one stretch in the fourth quarter.
"There was no pressure on them at all," Snow said. "All of the pressure was on us. Fortunately, we were able to pull this game out and now we have to take care of our home and win on Wednesday and even the series."
The Celtics, looking to move into the second round for the first time since 1992, were in position to close out the Sixers, taking a 103-100 lead on Rodney Rogers' 3-pointer with 1:32 remaining. But the Sixers scored the final eight points.
"It's a game we should have had," Boston forward Paul Pierce said. "We're up three with under three minutes to go. We gave ourselves a chance to win after being down in the first half. It's definitely one we should have had."
All season, the Celtics lived by the 3-pointer. On this day, however, they died by it.
Derrick Coleman, who played a strong game with 18 points and nine rebounds, followed Aaron McKie's miss to give Philadelphia a 104-103 lead with 45 seconds left.
Pierce scored 29 points for the Celtics, but missed a 3-pointer from the top of the key on the ensuing possession. Boston was forced to foul, and Iverson hit two more from the line, making it 106-103 with 19 seconds to play.
"I felt that everybody would come out and play the game like it was their last," Iverson said. "But we didn't have a choice. If you can't get up for a game like this, there's something wrong. You're not a basketball player, you're not a competitor."
Rogers and Pierce missed 3-pointers on Boston's last possession, and Coleman clinched the win with two from the line with 1.1 seconds to go.
"It's now Game 4," Pierce said. "We expected a war. We didn't expect Philly to bow down to us in Game 3. We expect another war for the next game."
Antoine Walker scored 27 points for Boston but was shut out from 3-point range in the second half after making all seven of his attempts from behind the arc in the opening 24 minutes. He finished 7-of-13 from downtown.
"We feel like we're still very confident we can beat them here," Walker said. "Obviously, they're going to feel really good and come out with a lot of energy on Wednesday. We have to be prepared and ready to match their energy again."
While the Sixers never have rallied to win a best-of-five series after losing the first two games, they have renewed hopes since Iverson seems to have shaken off the rust after missing the final 14 games of the regular season with a broken hand.
The NBA scoring champion rebounded from a shaky outing in Game 2, when he made just 10-of-29 shots. He took over Sunday's contest down the stretch, scoring 11 of the Sixers' final 15 points, and was deadly from the line, making 19-of-20 free throws.
"We had big games from a lot of people," Iverson said. "To beat a team like that, you're going to have to have a lot of guys contribute."
Overall, Philadelphia was 36-of-44 from the line, compared to just 16-of-18 for Boston, which ran most of its offense from the perimeter. The Sixers shot 45 percent (33-of-74).
"We didn't get the calls," Boston guard Kenny Anderson said. "We can't cry about it, but we didn't get the calls."
Spurred on by a fired-up crowd at the First Union Center, the Sixers opened an 11-point lead in the first quarter. Boston withstood Philadelphia's early burst and Walker's shooting helped it close to 58-52 at intermission.
The Celtics tried to bury the Sixers with a long-range assault, making 15 of 30 3-pointers, a playoff record for a Philadelphia opponent.
rust vs go 在 What is Rust and why is it so popular? - Stack Overflow Blog 的推薦與評價
The biggest benefit Rust can provide compared to these languages is the borrow checker. This is the part of the compiler responsible for ... ... <看更多>
rust vs go 在 How are Rust Traits different from Go Interfaces? - Software ... 的推薦與評價
Go has automatic method dispatch vs. Rust requires(?) impl s to implement a Trait · Rust has type parameters which allow for proper generics ... ... <看更多>
rust vs go 在 Go vs Rust garbage collector performance and type - Stack ... 的推薦與評價
... <看更多>