Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev-cli/cu): setting memory_limit issue / added module formats #1030

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions dev-cli/src/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async function GetMemoryLimit () {
} catch {
return memoryLimit
}

if (config) {
switch (config.preset) {
case 'xs':
Expand All @@ -82,8 +81,9 @@ async function GetMemoryLimit () {
break
}
}
if (config?.memory_limit) {
memoryLimit = `${config.memoryLimit}-b`

if (config?.maximum_memory) {
memoryLimit = `${config.maximum_memory}-b`
}
return memoryLimit
}
Expand All @@ -97,8 +97,12 @@ async function GetMemoryLimit () {
*/

export async function publish ({ wallet, bundler, tag, value }, contractWasmPath) {
tag.push('Memory-Limit')
value.push(await GetMemoryLimit())
tag = tag || []
value = value || []
if (!tag.includes('Memory-Limit')) {
tag.push('Memory-Limit')
value.push(await GetMemoryLimit())
}
const cmdArgs = [
...walletArgs(wallet),
...bundlerArgs(bundler),
Expand Down
2 changes: 1 addition & 1 deletion servers/cu/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MODE = process.env.NODE_CONFIG_ENV

if (!MODE) throw new Error('NODE_CONFIG_ENV must be defined')

const DEFAULT_PROCESS_WASM_MODULE_FORMATS = ['wasm32-unknown-emscripten', 'wasm32-unknown-emscripten2', 'wasm64-unknown-emscripten-draft_2024_02_15']
const DEFAULT_PROCESS_WASM_MODULE_FORMATS = ['wasm32-unknown-emscripten', 'wasm32-unknown-emscripten2', 'wasm32-unknown-emscripten3', 'wasm32-unknown-emscripten4', 'wasm64-unknown-emscripten-draft_2024_02_15']

/**
* The server config is an extension of the config required by the domain (business logic).
Expand Down