From c05969d549f5240bfae4f8a7aababe03f7574975 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 16 Feb 2023 12:50:26 +0100 Subject: [PATCH 1/4] double load fix --- apps/remix-ide/src/assets/js/loader.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/apps/remix-ide/src/assets/js/loader.js b/apps/remix-ide/src/assets/js/loader.js index 5e5bfb631f..98a39476f1 100644 --- a/apps/remix-ide/src/assets/js/loader.js +++ b/apps/remix-ide/src/assets/js/loader.js @@ -32,13 +32,6 @@ if (domains[window.location.hostname]) { })() } -createScriptTag = function (url, type) { - var script = document.createElement('script'); - script.src = url; - script.type = type; - document.getElementsByTagName('head')[0].appendChild(script); -}; - function isElectron() { // Renderer process if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { @@ -63,11 +56,5 @@ fetch(versionUrl, { cache: "no-store" }).then(response => { response.text().then(function (data) { const version = JSON.parse(data); console.log(`Loading Remix ${version.version}`); - createScriptTag(`polyfills.${version.version}.${version.timestamp}.js`, 'module'); - if (version.mode === 'development') { - createScriptTag(`vendor.${version.version}.${version.timestamp}.js`, 'module'); - createScriptTag(`runtime.${version.version}.${version.timestamp}.js`, 'module'); - } - createScriptTag(`main.${version.version}.${version.timestamp}.js`, 'text/javascript'); }); }); From c736d0a6971ffb9df9466ba8769a3505a0dfcd44 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Feb 2023 10:20:01 +0100 Subject: [PATCH 2/4] extend timeout for udapp --- apps/remix-ide/src/remixEngine.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide/src/remixEngine.js b/apps/remix-ide/src/remixEngine.js index 64fd918227..3a0c905acd 100644 --- a/apps/remix-ide/src/remixEngine.js +++ b/apps/remix-ide/src/remixEngine.js @@ -19,6 +19,7 @@ export class RemixEngine extends Engine { if (name === 'sourcify') return { queueTimeout: 60000 * 4 } if (name === 'fetchAndCompile') return { queueTimeout: 60000 * 4 } if (name === 'walletconnect') return { queueTimeout: 60000 * 4 } + if (name === 'udapp') return { queueTimeout: 60000 * 4 } return { queueTimeout: 10000 } } From def3475c1a7630d5577b4ae687808ba51669e2a0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Feb 2023 10:20:22 +0100 Subject: [PATCH 3/4] difficulty set to 0 for proof of stake --- libs/remix-lib/src/execution/txRunnerVM.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index b654ba7944..ed3562f30e 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -1,6 +1,6 @@ 'use strict' -import BN from 'bn.js' import { RunBlockResult, RunTxResult } from '@ethereumjs/vm' +import { ConsensusType } from '@ethereumjs/common' import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import { bufferToHex, Address } from '@ethereumjs/util' @@ -106,13 +106,14 @@ export class TxRunnerVM { const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e'] const difficulties = [69762765929000, 70762765929000, 71762765929000] - + const difficulty = this.commonContext.consensusType() === ConsensusType.ProofOfStake ? 0 : difficulties[self.blockNumber % difficulties.length] + const block = Block.fromBlockData({ header: { timestamp: new Date().getTime() / 1000 | 0, number: self.blockNumber, coinbase: coinbases[self.blockNumber % coinbases.length], - difficulty: difficulties[self.blockNumber % difficulties.length], + difficulty, gasLimit, baseFeePerGas: EIP1559 ? '0x1' : undefined }, From 42ae9d25bdccd34813aa996edca97001b005ebb2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Feb 2023 10:20:37 +0100 Subject: [PATCH 4/4] fix ordering of getting result --- libs/remix-simulator/src/methods/transactions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index bca6d05124..e7fbe6c225 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -156,9 +156,9 @@ export class Transactions { payload.params[0].gas = 10000000 * 10 this.vmContext.web3().flagNextAsDoNotRecordEvmSteps() - processTx(this.txRunnerInstance, payload, true, (error, value: VMexecutionResult) => { - const result: RunTxResult = value.result + processTx(this.txRunnerInstance, payload, true, (error, value: VMexecutionResult) => { if (error) return cb(error) + const result: RunTxResult = value.result if ((result as any).receipt?.status === '0x0' || (result as any).receipt?.status === 0) { try { const msg = `0x${result.execResult.returnValue.toString('hex') || '0'}`