Change Log#

v0.1.8#

Breaking Changes#

  1. Calldata encoding behavior changed - dataclasses now encoded automatically without requiring custom default parameter

  2. genlayer.py.public_abi file marked as auto-generated - manual edits will be overwritten

New Features#

  1. Enhanced calldata encoding: Automatic dataclass encoding support without custom default functions

  2. Standardized error types: New VmError enum for consistent error handling across the platform

  3. Extended public ABI: Additional constants for internal VM operations (CODE_SLOT_OFFSET)

API Improvements#

  1. Simplified dataclass serialization - no longer requires explicit default parameter in calldata.encode()

  2. Better type safety with standardized error enums

  3. Cleaner API for encoding complex data structures

v0.1.3#

Migration Guide#

This section provides code examples for migrating from v0.1.0 to v0.1.3:

Contract Interfaces#

# v0.1.0
contract = gl.ContractAt(address)
contract.view().some_method()
contract.emit().some_method()

# v0.1.3
contract = gl.get_contract_at(address)
contract.view().some_method()
contract.emit().some_method()

Error handling#

# v0.1.0
from genlayer import Rollback
gl.advanced.rollback_immediate("error message")

# v0.1.3
from genlayer.gl.vm import UserError  # or use gl.vm.UserError
gl.advanced.user_error_immediate("error message")

VM operations#

# v0.1.0
gl.advanced.run_nondet(leader_fn, validator_fn)

# v0.1.3
gl.vm.run_nondet(leader_fn, validator_fn)

EVM contracts#

# v0.1.0
@gl.eth_contract
class MyEthContract:
    # contract definition

# v0.1.3
@gl.evm.contract_interface
class MyEthContract:
    # contract definition

Non-deterministic functions#

# v0.1.0
result = gl.get_webpage(url, mode='text')
response = gl.exec_prompt("prompt text")

# v0.1.3
result = gl.nondet.web.render(url, mode='text')
response = gl.nondet.exec_prompt("prompt text")

Equivalence principles#

# v0.1.0
result = gl.eq_principle_strict_eq(fn)
result = gl.eq_principle_prompt_comparative(fn, principle)

# v0.1.3
result = gl.eq_principle.strict_eq(fn)
result = gl.eq_principle.prompt_comparative(fn, principle)

Breaking Changes#

  1. Removed Rollback exception from top-level imports - use genlayer.gl.vm.UserError instead

  2. Error handling methods now use #error and #get-schema special method names from genlayer.py.public_abi.SpecialMethod

  3. Contract interface changes: eth_contract renamed to evm_contract_interface in EVM module

New Features#

  1. Module reorganization: Core functionality moved to genlayer.gl namespace with lazy loading for better performance

  2. Contract interface system: New @contract_interface decorator for type-safe contract interactions

  3. Enhanced contract deployment: deploy_contract function with deterministic addressing via salt nonce

  4. Contract proxy system: get_contract_at function returns proxy objects with view() and emit() methods

  5. Advanced event system: Event class with proper topic generation and indexed field support

  6. VM operations: New genlayer.gl.vm module with run_nondet, spawn_sandbox functions

  7. EVM integration: Enhanced genlayer.py.evm module with contract generation capabilities

  8. Equivalence principles: New genlayer.gl.eq_principle module with strict_eq, prompt_comparative, prompt_non_comparative

  9. Advanced utilities: genlayer.gl.advanced module with user_error_immediate and emit_raw_event

API Improvements#

  1. Storage system improvements with better slot management

  2. Type annotations added for WASI bindings (_genlayer_wasi.pyi)

  3. Enhanced error handling with UserError replacing Rollback

  4. Better lazy loading system for improved import performance

  5. Documentation generation support with GENERATING_DOCS environment variable

v0.1.0#

Initial release