Skip to content

Commit

Permalink
fix: deploy to playground with EOP enabled (#4063)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesi200 authored Jan 15, 2025
1 parent c73715d commit c1d7978
Show file tree
Hide file tree
Showing 13 changed files with 1,096 additions and 110 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ This affects the following commands:
- `dfx canister update-settings`
- `dfx ledger fabricate-cycles`

### fix: `dfx` can deploy canisters to playground networks that have Motoko EOP enabled

Canisters with Motoko's Enhanced Orthogonal Persistence feature require `wasm_memory_persistence = Keep` when they get installed.
Previously, when `dfx` attempted to install canisters with EOP enabled to a playground it didn't set `wasm_memory_persistence` properly.

### chore: improve `dfx deploy` messages.

If users run `dfx deploy` without enough cycles, show additional messages to indicate what to do next.
Expand Down
1 change: 1 addition & 0 deletions e2e/assets/playground_backend/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "custom",
"candid": "wasm-utils.did",
"wasm": "wasm-utils.wasm",
"specified_id": "ozk6r-tyaaa-aaaab-qab4a-cai",
"build": [
"echo 'the wasm-utils canister is prebuilt'"
]
Expand Down
7 changes: 4 additions & 3 deletions e2e/assets/playground_backend/mops.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[dependencies]
base = "0.10.4"
base = "0.12.1"
splay = "0.1.0"

[toolchain]
moc = "0.10.4"
[[canister]]
candid = "service/wasm-utils/wasm-utils.did"
output = "service/pool/Wasm-utils.mo"
320 changes: 320 additions & 0 deletions e2e/assets/playground_backend/service/pool/EVM.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,320 @@
// This is a generated Motoko binding.
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.

module {
public type AccessListEntry = { storageKeys : [Text]; address : Text };
public type Block = {
miner : Text;
totalDifficulty : ?Nat;
receiptsRoot : Text;
stateRoot : Text;
hash : Text;
difficulty : ?Nat;
size : Nat;
uncles : [Text];
baseFeePerGas : ?Nat;
extraData : Text;
transactionsRoot : ?Text;
sha3Uncles : Text;
nonce : Nat;
number : Nat;
timestamp : Nat;
transactions : [Text];
gasLimit : Nat;
logsBloom : Text;
parentHash : Text;
gasUsed : Nat;
mixHash : Text;
};
public type BlockTag = {
#Earliest;
#Safe;
#Finalized;
#Latest;
#Number : Nat;
#Pending;
};
public type CallArgs = {
transaction : TransactionRequest;
block : ?BlockTag;
};
public type CallResult = { #Ok : Text; #Err : RpcError };
public type ChainId = Nat64;
public type ConsensusStrategy = {
#Equality;
#Threshold : { min : Nat8; total : ?Nat8 };
};
public type EthMainnetService = {
#Alchemy;
#Llama;
#BlockPi;
#Cloudflare;
#PublicNode;
#Ankr;
};
public type EthSepoliaService = {
#Alchemy;
#BlockPi;
#PublicNode;
#Ankr;
#Sepolia;
};
public type FeeHistory = {
reward : [[Nat]];
gasUsedRatio : [Float];
oldestBlock : Nat;
baseFeePerGas : [Nat];
};
public type FeeHistoryArgs = {
blockCount : Nat;
newestBlock : BlockTag;
rewardPercentiles : ?Blob;
};
public type FeeHistoryResult = { #Ok : FeeHistory; #Err : RpcError };
public type GetBlockByNumberResult = { #Ok : Block; #Err : RpcError };
public type GetLogsArgs = {
fromBlock : ?BlockTag;
toBlock : ?BlockTag;
addresses : [Text];
topics : ?[Topic];
};
public type GetLogsResult = { #Ok : [LogEntry]; #Err : RpcError };
public type GetTransactionCountArgs = { address : Text; block : BlockTag };
public type GetTransactionCountResult = { #Ok : Nat; #Err : RpcError };
public type GetTransactionReceiptResult = {
#Ok : ?TransactionReceipt;
#Err : RpcError;
};
public type HttpHeader = { value : Text; name : Text };
public type HttpOutcallError = {
#IcError : { code : RejectionCode; message : Text };
#InvalidHttpJsonRpcResponse : {
status : Nat16;
body : Text;
parsingError : ?Text;
};
};
public type InstallArgs = {
logFilter : ?LogFilter;
demo : ?Bool;
manageApiKeys : ?[Principal];
};
public type JsonRpcError = { code : Int64; message : Text };
public type L2MainnetService = {
#Alchemy;
#Llama;
#BlockPi;
#PublicNode;
#Ankr;
};
public type LogEntry = {
transactionHash : ?Text;
blockNumber : ?Nat;
data : Text;
blockHash : ?Text;
transactionIndex : ?Nat;
topics : [Text];
address : Text;
logIndex : ?Nat;
removed : Bool;
};
public type LogFilter = {
#ShowAll;
#HideAll;
#ShowPattern : Regex;
#HidePattern : Regex;
};
public type Metrics = {
cyclesWithdrawn : Nat;
responses : [((Text, Text, Text), Nat64)];
errNoPermission : Nat64;
inconsistentResponses : [((Text, Text), Nat64)];
cyclesCharged : [((Text, Text), Nat)];
requests : [((Text, Text), Nat64)];
errHttpOutcall : [((Text, Text), Nat64)];
errHostNotAllowed : [(Text, Nat64)];
};
public type MultiCallResult = {
#Consistent : CallResult;
#Inconsistent : [(RpcService, CallResult)];
};
public type MultiFeeHistoryResult = {
#Consistent : FeeHistoryResult;
#Inconsistent : [(RpcService, FeeHistoryResult)];
};
public type MultiGetBlockByNumberResult = {
#Consistent : GetBlockByNumberResult;
#Inconsistent : [(RpcService, GetBlockByNumberResult)];
};
public type MultiGetLogsResult = {
#Consistent : GetLogsResult;
#Inconsistent : [(RpcService, GetLogsResult)];
};
public type MultiGetTransactionCountResult = {
#Consistent : GetTransactionCountResult;
#Inconsistent : [(RpcService, GetTransactionCountResult)];
};
public type MultiGetTransactionReceiptResult = {
#Consistent : GetTransactionReceiptResult;
#Inconsistent : [(RpcService, GetTransactionReceiptResult)];
};
public type MultiSendRawTransactionResult = {
#Consistent : SendRawTransactionResult;
#Inconsistent : [(RpcService, SendRawTransactionResult)];
};
public type Provider = {
access : RpcAccess;
alias : ?RpcService;
chainId : ChainId;
providerId : ProviderId;
};
public type ProviderError = {
#TooFewCycles : { expected : Nat; received : Nat };
#InvalidRpcConfig : Text;
#MissingRequiredProvider;
#ProviderNotFound;
#NoPermission;
};
public type ProviderId = Nat64;
public type Regex = Text;
public type RejectionCode = {
#NoError;
#CanisterError;
#SysTransient;
#DestinationInvalid;
#Unknown;
#SysFatal;
#CanisterReject;
};
public type RequestCostResult = { #Ok : Nat; #Err : RpcError };
public type RequestResult = { #Ok : Text; #Err : RpcError };
public type RpcAccess = {
#Authenticated : { publicUrl : ?Text; auth : RpcAuth };
#Unauthenticated : { publicUrl : Text };
};
public type RpcApi = { url : Text; headers : ?[HttpHeader] };
public type RpcAuth = {
#BearerToken : { url : Text };
#UrlParameter : { urlPattern : Text };
};
public type RpcConfig = {
responseConsensus : ?ConsensusStrategy;
responseSizeEstimate : ?Nat64;
};
public type RpcError = {
#JsonRpcError : JsonRpcError;
#ProviderError : ProviderError;
#ValidationError : ValidationError;
#HttpOutcallError : HttpOutcallError;
};
public type RpcService = {
#EthSepolia : EthSepoliaService;
#BaseMainnet : L2MainnetService;
#Custom : RpcApi;
#OptimismMainnet : L2MainnetService;
#ArbitrumOne : L2MainnetService;
#EthMainnet : EthMainnetService;
#Provider : ProviderId;
};
public type RpcServices = {
#EthSepolia : ?[EthSepoliaService];
#BaseMainnet : ?[L2MainnetService];
#Custom : { chainId : ChainId; services : [RpcApi] };
#OptimismMainnet : ?[L2MainnetService];
#ArbitrumOne : ?[L2MainnetService];
#EthMainnet : ?[EthMainnetService];
};
public type SendRawTransactionResult = {
#Ok : SendRawTransactionStatus;
#Err : RpcError;
};
public type SendRawTransactionStatus = {
#Ok : ?Text;
#NonceTooLow;
#NonceTooHigh;
#InsufficientFunds;
};
public type Topic = [Text];
public type TransactionReceipt = {
to : ?Text;
status : ?Nat;
transactionHash : Text;
blockNumber : Nat;
from : Text;
logs : [LogEntry];
blockHash : Text;
type_ : Text;
transactionIndex : Nat;
effectiveGasPrice : Nat;
logsBloom : Text;
contractAddress : ?Text;
gasUsed : Nat;
};
public type TransactionRequest = {
to : ?Text;
gas : ?Nat;
maxFeePerGas : ?Nat;
gasPrice : ?Nat;
value : ?Nat;
maxFeePerBlobGas : ?Nat;
from : ?Text;
type_ : ?Text;
accessList : ?[AccessListEntry];
nonce : ?Nat;
maxPriorityFeePerGas : ?Nat;
blobs : ?[Text];
input : ?Text;
chainId : ?Nat;
blobVersionedHashes : ?[Text];
};
public type ValidationError = { #Custom : Text; #InvalidHex : Text };
public type Self = actor {
eth_call : shared (
RpcServices,
?RpcConfig,
CallArgs,
) -> async MultiCallResult;
eth_feeHistory : shared (
RpcServices,
?RpcConfig,
FeeHistoryArgs,
) -> async MultiFeeHistoryResult;
eth_getBlockByNumber : shared (
RpcServices,
?RpcConfig,
BlockTag,
) -> async MultiGetBlockByNumberResult;
eth_getLogs : shared (
RpcServices,
?RpcConfig,
GetLogsArgs,
) -> async MultiGetLogsResult;
eth_getTransactionCount : shared (
RpcServices,
?RpcConfig,
GetTransactionCountArgs,
) -> async MultiGetTransactionCountResult;
eth_getTransactionReceipt : shared (
RpcServices,
?RpcConfig,
Text,
) -> async MultiGetTransactionReceiptResult;
eth_sendRawTransaction : shared (
RpcServices,
?RpcConfig,
Text,
) -> async MultiSendRawTransactionResult;
getMetrics : shared query () -> async Metrics;
getNodesInSubnet : shared query () -> async Nat32;
getProviders : shared query () -> async [Provider];
getServiceProviderMap : shared query () -> async [(RpcService, ProviderId)];
request : shared (RpcService, Text, Nat64) -> async RequestResult;
requestCost : shared query (
RpcService,
Text,
Nat64,
) -> async RequestCostResult;
updateApiKeys : shared [(ProviderId, ?Text)] -> async ();
}
}

Loading

0 comments on commit c1d7978

Please sign in to comment.