-
Notifications
You must be signed in to change notification settings - Fork 346
[SNatives] Implement mainline Ethereum precompiles #1240
Comments
It seems that you have implemented the SHA256, RIPEMD160 and the Identity functions. The ones that are no implemented are the 1st and the 5 last ones (the 5,6,7,8 and the 9th, the blake2F that is part of the Istanbul hard fork). For my project I need the 5,6,7 so I'll start to work with the 5th. |
I should have originally remembered we do of course have 2, 3, 4 already implemented. There was some prior work done for @seanyoung has completed to refactoring work I was keen to see get in before this and I will review and merge shortly: #1242. So @madiazp if you could base your work on |
I am copying this in from chat.hyperledger.org for visibility from @madiazp:
Yes Burrow should have all the opcodes from Constantinople. Our approaches to new opcodes that Ethereum has to handle as a hard fork at a particular height is to just add the opcodes to the latest Burrow. Unlike go-ethereum Burrow has no conditional logic to change its operation on certain threshold heights. This is something we could add if there was demand but it adds complexity and implementing the latest standard without conditional logic or further indirection helps us stay a bit more agile and lets us make some hay out of being EVM but not protocol compatible with mainnet. Also since we have no single chain to reference we would need configuration for each of the upgrade thresholds. Our approach to chain upgrades is via our dump/restore functionality (see: http://hyperledger.github.io/burrow/#/tutorials/7-dump-restore). I think we may want to consider recasting this as Burrow 'forking', right now it is discussed mostly in the language of 'backing up a chain' but really what it does is allows you to import state into a new chain and via the genesis |
Ok, So the contracts that will be included are the Istambul ones. The https://github.com/hyperledger/burrow/pull/1242/files also applies on the natives? the description struct and so on didn't seems to be applied to them. |
|
…s of the hyperledger-archives#1283 PR. Signed-off-by: matias diaz <matias.dpz@gmail.com>
9th precompile: ethereum/EIPs#152 |
Hello community. Any updates on first precompile ? |
recovery of ecdsa signature: #1415 |
Ethereum ships with a number of 'precompile' contracts - implemented in the native language of the VM our equivalent is SNatives.
We should aim to implement all the same precompiles that mainline Ethereum clients do, which are listed below along with their addresses.
@madiazp has expressed an interest in work on implementing some of these, which we would very gratefully accept! See #1224 for some background motivation for this ticket.
It might make sense to split this ticket between the first four basic precompiles which will be much more straightforward to implement than the newer elliptic curve primitives.
The explicit precompile addresses can be configured here: https://github.com/hyperledger/burrow/blob/develop/execution/evm/native.go#L50-L52
0x1
: Recovery of ECDSA signature0x2
: Hash function SHA2560x3
: Hash function RIPEMD1600x4
: Identity (i.e. return whatever input is)0x5
: Modular exponentiation (EIP 198)0x6
: Addition on elliptic curve alt_bn128 (EIP 196)0x7
: Scalar multiplication on elliptic curve alt_bn128 (EIP 196)0x8
: Checking a pairing equation on curve alt_bn128 (EIP 197)List above adapted from: https://ethereum.stackexchange.com/questions/15479/list-of-pre-compiled-contracts
The text was updated successfully, but these errors were encountered: