Skip to content

Commit

Permalink
Wasm sc integration (#1558)
Browse files Browse the repository at this point in the history
* Add wasmex dep

* Add wasm module

* Test with ContractV2

* Support native upgrade

* Performs about exported vs spec functions

* Improve linting for ContractV2

* Improve linting for WASM modules

* support UTXO balance

* support I/O mocks

* update wasm for tests

* rename init with onInit

* refactor

* Update with manifest to generate spec

* update tx code to hold json

* fix code validation size in mining

* support wasm onInherit

* getBalance IO function

* implement lib functions

* use the Hex struct

* add contract seed to the wasmmemory

* implement remaining functions

* adapt mock

* update contract in test

* handle type checking & casting

* support recipient

* skip execute_condition for wasm contract

* fix format

* Integrate genesis & contract constants

* improve onInit call

* improve recipients arguments

* clean

* lint

* Support only map as argument for wasm contract

* Support only map as argument for wasm contract

* Add `contract` to transaction data to hold wasm contract def

* Increase contract's code size limit

* Customize version for transaction in tests and playbooks

* Refactoring

* Uniform error codes RPC

* Use typedencoding for contract manifest serialization

* fix loading contract in worker

* fix output

* fix merge

* Fix merge'

* Fix merge

* Fix wasmex version

* fix serialization issue

* fix lint

* Fix wasm output cast on list

* Add WasmSpec.get_function_spec

* Fix cast output for json rpc call

* Add TransactionData.Contract struct

* distinct tx version 3 and 4

* wasm contract set transaction version

* Fix tests

* fix dialyzer

* fix credo

* Add Contract.set_contract function in interpreter

* Forbid transaction V4 on mainnet

* Remove thing in db

---------

Co-authored-by: bchamagne <[email protected]>
Co-authored-by: Neylix <[email protected]>
  • Loading branch information
3 people authored Dec 31, 2024
1 parent 3132b64 commit d5aab57
Show file tree
Hide file tree
Showing 109 changed files with 4,227 additions and 1,761 deletions.
5 changes: 3 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ config :archethic, :mut_dir, "data"
config :archethic, :marker, "-=%=-=%=-=%=-"

# size represents in bytes binary
# 3 MB
config :archethic, :transaction_data_content_max_size, 3_145_728

# size represents in bytes binary
# 24KB Max
config :archethic, :transaction_data_code_max_size, 24576
# 256 KB
config :archethic, :transaction_data_code_max_size, 262_144

config :archethic, Archethic.Crypto,
supported_curves: [
Expand Down
2 changes: 2 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,5 @@ config :archethic, Archethic.Contracts.Interpreter.Library.Common.HttpImpl,

config :archethic, Archethic.P2P.Message.GetUnspentOutputs, threshold: 1_000
config :archethic, Archethic.P2P.Message.ValidateSmartContractCall, timeout: 50

config :archethic, Archethic.Contracts.Wasm.IO, MockWasmIO
Loading

0 comments on commit d5aab57

Please sign in to comment.