From 6879b1dcd231450761bb648b62acb9b56118a04b Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 31 May 2021 11:12:51 +0200 Subject: [PATCH 01/11] exclude builtin version from check --- apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js index 6c09d0586e..bbdfdc1314 100644 --- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js +++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js @@ -487,7 +487,7 @@ class CompilerContainer { this._view.versionSelector.appendChild(option) } }) - if (semver.lt(this._retrieveVersion(), 'v0.4.12+commit.194ff033.js')) { + if (this.data.selectedVersion !== 'builtin' && semver.lt(this._retrieveVersion(), 'v0.4.12+commit.194ff033.js')) { toaster(yo`
Old compiler usage detected. From e6d65283f8d21450c62135c978fd3042462e0e9c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 31 May 2021 13:50:46 +0200 Subject: [PATCH 02/11] fix loading local compiler --- apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js index bbdfdc1314..dfb0cfc5a4 100644 --- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js +++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js @@ -170,6 +170,7 @@ class CompilerContainer { _retrieveVersion (version) { if (!version) version = this._view.versionSelector.value + if (version === 'builtin') version = this.data.defaultVersion return semver.coerce(version) ? semver.coerce(version).version : '' } @@ -500,7 +501,7 @@ class CompilerContainer { // Workers cannot load js on "file:"-URLs and we get a // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // resort to non-worker version in that case. - if (this.data.selectedVersion !== 'builtin' && canUseWorker(this.data.selectedVersion)) { + if (canUseWorker(this._retrieveVersion())) { this.compileTabLogic.compiler.loadVersion(true, url) this.setVersionText('(loading using worker)') } else { diff --git a/package.json b/package.json index 403e253716..ccafdfdadf 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "bumpVersion:libs": "gulp & gulp syncLibVersions;", "browsertest": "sleep 5 && npm run nightwatch_local", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/", - "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.4+commit.c7e474f2.js -O ./apps/remix-ide/src/assets/js/soljson.js", + "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.4+commit.c7e474f2.js -O ./apps/remix-ide/src/assets/js/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox", From db47a3dd6d96faa85d3450aa01e3c0e534b7ad39 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 31 May 2021 15:29:14 +0200 Subject: [PATCH 03/11] add soljson.js when publishing --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bde004212a..632f1059a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -268,6 +268,7 @@ jobs: - setup_remote_docker - run: npm install - run: npx nx build remix-ide --with-deps + - run: npm run downloadsolc_assets - run: ./apps/remix-ide/ci/copy_resources.sh - run: ./apps/remix-ide/ci/publishIpfs - run: ./apps/remix-ide/ci/build_and_publish_docker_images.sh From b1e699f4981ade74ab809bf959990fe76d68ddd0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 1 Jun 2021 13:20:51 +0200 Subject: [PATCH 04/11] fix downloadsolc_assets call --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 632f1059a7..e2f5431ee1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -238,8 +238,8 @@ jobs: steps: - checkout - run: npm install - - run: npx nx build remix-ide --with-deps - run: npm run downloadsolc_assets + - run: npx nx build remix-ide --with-deps - run: name: Deploy command: | @@ -267,8 +267,8 @@ jobs: - checkout - setup_remote_docker - run: npm install - - run: npx nx build remix-ide --with-deps - run: npm run downloadsolc_assets + - run: npx nx build remix-ide --with-deps - run: ./apps/remix-ide/ci/copy_resources.sh - run: ./apps/remix-ide/ci/publishIpfs - run: ./apps/remix-ide/ci/build_and_publish_docker_images.sh @@ -292,8 +292,8 @@ jobs: steps: - checkout - run: npm install - - run: npx nx build remix-ide --with-deps - run: npm run downloadsolc_assets + - run: npx nx build remix-ide --with-deps - run: name: Deploy command: | @@ -321,8 +321,8 @@ jobs: - checkout - run: npm install - run: npm run build:libs - - run: npm run build - run: npm run downloadsolc_assets + - run: npm run build - run: name: Deploy command: | From db93a7f570476b1b4ae9bc68c637a4a14b16203c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 1 Jun 2021 15:45:19 +0200 Subject: [PATCH 05/11] add dgit to required --- apps/remix-ide/src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index a483143ba3..26f684e432 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -9,7 +9,7 @@ const _paq = window._paq = window._paq || [] const requiredModules = [ // services + layout views + system views 'manager', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme', 'fileManager', 'contentImport', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', - 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp'] + 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider'] const dependentModules = ['git', 'hardhat'] // module which shouldn't be manually activated (e.g git is activated by remixd) From 79ebac8e684e9efbcec610b3f66e65b32a512b0a Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 1 Jun 2021 11:21:28 +0200 Subject: [PATCH 06/11] fix missing return --- libs/remix-tests/src/deployer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-tests/src/deployer.ts b/libs/remix-tests/src/deployer.ts index 1e3fcb8d88..aeefac3faa 100644 --- a/libs/remix-tests/src/deployer.ts +++ b/libs/remix-tests/src/deployer.ts @@ -110,7 +110,7 @@ export function deployAll (compileResult: compilationInterface, web3: Web3, with const params = '' // we suppose that the test contract does not have any param in the constructor execution.txFormat.encodeConstructorCallAndDeployLibraries(contractName, contract.raw, compileResult, params, funAbi, encodeDataFinalCallback, encodeDataStepCallback, encodeDataDeployLibraryCallback) }, function (err) { - if (err) next(err) + if (err) return next(err) next(null, contracts) }) } From 0daf7f19b1bcd286dd8bd328fee9cdbd1b8375e4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 1 Jun 2021 11:24:14 +0200 Subject: [PATCH 07/11] add missing redeploy with double gas --- libs/remix-tests/src/runTestFiles.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/remix-tests/src/runTestFiles.ts b/libs/remix-tests/src/runTestFiles.ts index 6bde83e44e..b447452f22 100644 --- a/libs/remix-tests/src/runTestFiles.ts +++ b/libs/remix-tests/src/runTestFiles.ts @@ -63,9 +63,16 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 } deployAll(compilationResult, web3, false, (err, contracts) => { if (err) { - next(err) - } - next(null, compilationResult, contracts) + // If contract deployment fails because of 'Out of Gas' error, try again with double gas + // This is temporary, should be removed when remix-tests will have a dedicated UI to + // accept deployment params from UI + if (err.message.includes('The contract code couldn\'t be stored, please check your gas limit')) { + deployAll(compilationResult, web3, true, (error, contracts) => { + if (error) next([{ message: 'contract deployment failed after trying twice: ' + error.message, severity: 'error' }]) // IDE expects errors in array + else next(null, compilationResult, contracts) + }) + } else { next([{ message: 'contract deployment failed: ' + err.message, severity: 'error' }]) } // IDE expects errors in array + } else { next(null, compilationResult, contracts) } }) }, function determineTestContractsToRun (compilationResult: compilationInterface, contracts: any, next) { From dea29b069b265914fcdc57ed6b38a50780c52e72 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 1 Jun 2021 17:22:59 +0200 Subject: [PATCH 08/11] set allowUnlimitedContractSize to true & raise the gaslimit --- libs/remix-simulator/src/methods/transactions.ts | 2 +- libs/remix-simulator/src/vm-context.ts | 3 ++- libs/remix-tests/src/testRunner.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index c3a43f5bc4..f63715b57e 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -113,7 +113,7 @@ export class Transactions { } eth_estimateGas (payload, cb) { - cb(null, 3000000) + cb(null, 9000000000000000) } eth_getCode (payload, cb) { diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index a72be89d1e..a6406b2391 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -122,7 +122,8 @@ export class VMContext { const vm = new VM({ common, activatePrecompiles: true, - stateManager: stateManager + stateManager: stateManager, + allowUnlimitedContractSize: true }) const web3vm = new remixLibVm.Web3VMProvider() diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index d64398b390..d4ecd3bfc0 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -238,7 +238,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com sender = opts.accounts[sender] } } - let sendParams: Record | null = null + let sendParams: Record | null = null if (sender) sendParams = { from: sender } if (func.inputs && func.inputs.length > 0) { return resultsCallback(new Error(`Method '${func.name}' can not have parameters inside a test contract`), { passingNum, failureNum, timePassed }) } const method = testObject.methods[func.name].apply(testObject.methods[func.name], []) @@ -280,6 +280,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com else sendParams = { value } } } + if (!sendParams) sendParams = {} + sendParams.gas = 9000000000000000 method.send(sendParams).on('receipt', (receipt) => { try { const time: number = (Date.now() - startTime) / 1000.0 From dcfa3422e802b06ce69acfb081f59d0fd35aa20e Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 2 Jun 2021 09:41:30 +0200 Subject: [PATCH 09/11] fix e2e tests --- apps/remix-ide-e2e/src/tests/ballot.test.ts | 2 +- apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts | 2 +- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index 09ec283572..a081f332ee 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -49,7 +49,7 @@ module.exports = { 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { browser.pause(500) - .click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]') + .click('*[data-id="txLoggerDebugButton0x57c8e1437fa09b6b6a866e1d68fefd71cd2fec53f484b1dac9a2505ae95b2a7b"]') .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .pause(2000) diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts index 04439e0185..dd02c863f1 100644 --- a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts +++ b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts @@ -45,7 +45,7 @@ module.exports = { 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { browser.pause(500) - .click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]') + .click('*[data-id="txLoggerDebugButton0x57c8e1437fa09b6b6a866e1d68fefd71cd2fec53f484b1dac9a2505ae95b2a7b"]') .pause(2000) .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 6365793479..dd6a15dc15 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -420,7 +420,7 @@ const localVariable_step717_ABIEncoder = { // eslint-disable-line const jsGetTrace = `(async () => { try { - const result = await remix.call('debugger', 'getTrace', '0xbf309c0d71579d595f04a42e89d66d1ec17523dd3edea710b03f46a9b82ee0af') + const result = await remix.call('debugger', 'getTrace', '0x0a4d155d88ec6030d1ce43eab40067d314ba15eb2ae072172eb406792f618d91') console.log('result ', result) } catch (e) { console.log(e.message) @@ -429,7 +429,7 @@ const jsGetTrace = `(async () => { const jsDebug = `(async () => { try { - const result = await remix.call('debugger', 'debug', '0xbf309c0d71579d595f04a42e89d66d1ec17523dd3edea710b03f46a9b82ee0af') + const result = await remix.call('debugger', 'debug', '0x0a4d155d88ec6030d1ce43eab40067d314ba15eb2ae072172eb406792f618d91') console.log('result ', result) } catch (e) { console.log(e.message) From bcb553b27a14fbbf10587d9b1721deca314d115b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 2 Jun 2021 12:05:59 +0200 Subject: [PATCH 10/11] fix gas limit --- libs/remix-simulator/src/methods/transactions.ts | 2 +- libs/remix-tests/src/testRunner.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index f63715b57e..2ea3d11d54 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -113,7 +113,7 @@ export class Transactions { } eth_estimateGas (payload, cb) { - cb(null, 9000000000000000) + cb(null, 10000000 * 8) } eth_getCode (payload, cb) { diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index d4ecd3bfc0..66efa143fe 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -281,7 +281,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com } } if (!sendParams) sendParams = {} - sendParams.gas = 9000000000000000 + sendParams.gas = 10000000 * 8 method.send(sendParams).on('receipt', (receipt) => { try { const time: number = (Date.now() - startTime) / 1000.0 From c33e3983fdef091e67e8ff1d92938201141df494 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 2 Jun 2021 13:04:47 +0200 Subject: [PATCH 11/11] fix e2e tests --- apps/remix-ide-e2e/src/tests/ballot.test.ts | 2 +- apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts | 2 +- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index a081f332ee..b44b17746e 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -49,7 +49,7 @@ module.exports = { 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { browser.pause(500) - .click('*[data-id="txLoggerDebugButton0x57c8e1437fa09b6b6a866e1d68fefd71cd2fec53f484b1dac9a2505ae95b2a7b"]') + .click('*[data-id="txLoggerDebugButton0xf88bc0ac0761f78d8c883b32550c68dadcdb095595c30e1a1b7c583e5e958dcb"]') .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .pause(2000) diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts index dd02c863f1..a3bf500ec0 100644 --- a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts +++ b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts @@ -45,7 +45,7 @@ module.exports = { 'Debug Ballot / delegate': function (browser: NightwatchBrowser) { browser.pause(500) - .click('*[data-id="txLoggerDebugButton0x57c8e1437fa09b6b6a866e1d68fefd71cd2fec53f484b1dac9a2505ae95b2a7b"]') + .click('*[data-id="txLoggerDebugButton0xf88bc0ac0761f78d8c883b32550c68dadcdb095595c30e1a1b7c583e5e958dcb"]') .pause(2000) .waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') .click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]') diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index dd6a15dc15..d6b1cb2743 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -420,7 +420,7 @@ const localVariable_step717_ABIEncoder = { // eslint-disable-line const jsGetTrace = `(async () => { try { - const result = await remix.call('debugger', 'getTrace', '0x0a4d155d88ec6030d1ce43eab40067d314ba15eb2ae072172eb406792f618d91') + const result = await remix.call('debugger', 'getTrace', '0xa38bff6f06e7c4fc91df1db6aa31a69ab5d5882faa953b1e7a88bfa523268ed7') console.log('result ', result) } catch (e) { console.log(e.message) @@ -429,7 +429,7 @@ const jsGetTrace = `(async () => { const jsDebug = `(async () => { try { - const result = await remix.call('debugger', 'debug', '0x0a4d155d88ec6030d1ce43eab40067d314ba15eb2ae072172eb406792f618d91') + const result = await remix.call('debugger', 'debug', '0xa38bff6f06e7c4fc91df1db6aa31a69ab5d5882faa953b1e7a88bfa523268ed7') console.log('result ', result) } catch (e) { console.log(e.message)