@@ -14,7 +14,7 @@ export function Configurations ({primeValue, setPrimeValue}: ConfigurationsProps
placement={"auto"}
tooltipId="circuitPrimeLabelTooltip"
tooltipClasses="text-nowrap"
- tooltipText={{'To choose the prime number to use to generate the circuit. Receives the name of the curve (bn128, bls12381, goldilocks) [default: bn128]'}}
+ tooltipText={{'To choose the prime number to use to generate the circuit. Receives the name of the curve (bn128, bls12381, goldilocks, grumpkin, pallas, vesta)'}}
>
diff --git a/apps/circuit-compiler/src/app/components/container.tsx b/apps/circuit-compiler/src/app/components/container.tsx
index d56036e44d..fa7467f69c 100644
--- a/apps/circuit-compiler/src/app/components/container.tsx
+++ b/apps/circuit-compiler/src/app/components/container.tsx
@@ -29,6 +29,7 @@ export function Container () {
}
const handleVersionSelect = (version: string) => {
+ circuitApp.plugin.compilerVersion = version
circuitApp.dispatch({ type: 'SET_COMPILER_VERSION', payload: version })
}
@@ -44,7 +45,8 @@ export function Container () {
}
}
- const handlePrimeChange = (value: string) => {
+ const handlePrimeChange = (value: PrimeValue) => {
+ circuitApp.plugin.compilerPrime = value
circuitApp.dispatch({ type: 'SET_PRIME_VALUE', payload: value as PrimeValue })
}
@@ -75,7 +77,7 @@ export function Container () {
-
+ 0}>
diff --git a/apps/circuit-compiler/src/app/services/circomPluginClient.ts b/apps/circuit-compiler/src/app/services/circomPluginClient.ts
index 0eccddb281..b4c3ecc9ad 100644
--- a/apps/circuit-compiler/src/app/services/circomPluginClient.ts
+++ b/apps/circuit-compiler/src/app/services/circomPluginClient.ts
@@ -2,19 +2,22 @@ import { PluginClient } from '@remixproject/plugin'
import { createClient } from '@remixproject/plugin-webview'
import EventManager from 'events'
import pathModule from 'path'
-import { parse, compile, generate_witness, generate_r1cs, compiler_list } from 'circom_wasm'
+import { compiler_list } from 'circom_wasm'
+import * as compilerV216 from 'circom_wasm/v2.1.6'
+import * as compilerV215 from 'circom_wasm/v2.1.5'
import { extractNameFromKey, extractParentFromKey } from '@remix-ui/helper'
-import { CompilationConfig, CompilerReport, ResolverOutput } from '../types'
+import { CompilationConfig, CompilerReport, PrimeValue, ResolverOutput } from '../types'
export class CircomPluginClient extends PluginClient {
public internalEvents: EventManager
private _compilationConfig: CompilationConfig = {
- version: "2.1.5",
+ version: "2.1.6",
prime: "bn128"
}
private lastCompiledCircuitPath: string = ''
private lastParsedFiles: Record = {}
private lastCompiledFile: string = ''
+ private compiler: typeof compilerV215 | typeof compilerV216 = compilerV216
constructor() {
super()
@@ -32,13 +35,26 @@ export class CircomPluginClient extends PluginClient {
this.internalEvents.emit('circom_activated')
}
+ set compilerVersion (version: string) {
+ if (!compiler_list.versions.includes(version)) throw new Error("Unsupported compiler version")
+ this._compilationConfig.version = version
+ if (version === '2.1.5') this.compiler = compilerV215
+ else if (version === '2.1.6') this.compiler = compilerV216
+ }
+
+ set compilerPrime (prime: PrimeValue) {
+ if ((prime !== "bn128") && (prime !== "bls12381") && (prime !== "goldilocks") && (this._compilationConfig.version === '2.1.5')) throw new Error('Invalid prime value')
+ if ((prime !== "bn128") && (prime !== "bls12381") && (prime !== "goldilocks") && (prime !== "grumpkin") && (prime !== "pallas") && (prime !== "vesta") && (this._compilationConfig.version === '2.1.6')) throw new Error('Invalid prime value')
+ this._compilationConfig.prime = prime
+ }
+
async parse(path: string, fileContent?: string): Promise<[CompilerReport[], Record]> {
if (!fileContent) {
// @ts-ignore
fileContent = await this.call('fileManager', 'readFile', path)
}
this.lastParsedFiles = await this.resolveDependencies(path, fileContent, { [path]: { content: fileContent, parent: null } })
- const parsedOutput = parse(path, this.lastParsedFiles)
+ const parsedOutput = this.compiler.parse(path, this.lastParsedFiles)
try {
const result: CompilerReport[] = JSON.parse(parsedOutput.report())
@@ -122,12 +138,10 @@ export class CircomPluginClient extends PluginClient {
if (compilationConfig) {
const { prime, version } = compilationConfig
- if ((prime !== "bn128") && (prime !== "bls12381") && (prime !== "goldilocks")) throw new Error('Invalid prime value')
- if (!compiler_list.versions.includes(version)) throw new Error("Unsupported compiler version")
- this._compilationConfig.prime = prime
- this._compilationConfig.version = version
+ this.compilerVersion = version
+ this.compilerPrime = prime
}
- const circuitApi = compile(path, this.lastParsedFiles, { prime: this._compilationConfig.prime })
+ const circuitApi = this.compiler.compile(path, this.lastParsedFiles, { prime: this._compilationConfig.prime })
const circuitProgram = circuitApi.program()
if (circuitProgram.length < 1) {
@@ -172,12 +186,10 @@ export class CircomPluginClient extends PluginClient {
if (compilationConfig) {
const { prime, version } = compilationConfig
- if ((prime !== "bn128") && (prime !== "bls12381") && (prime !== "goldilocks")) throw new Error('Invalid prime value')
- if (!compiler_list.versions.includes(version)) throw new Error("Unsupported compiler version")
- this._compilationConfig.prime = prime
- this._compilationConfig.version = version
+ this.compilerVersion = version
+ this.compilerPrime = prime
}
- const r1csApi = generate_r1cs(path, this.lastParsedFiles, { prime: this._compilationConfig.prime })
+ const r1csApi = this.compiler.generate_r1cs(path, this.lastParsedFiles, { prime: this._compilationConfig.prime })
const r1csProgram = r1csApi.program()
if (r1csProgram.length < 1) {
@@ -202,7 +214,7 @@ export class CircomPluginClient extends PluginClient {
// @ts-ignore
const buffer: any = await this.call('fileManager', 'readFile', wasmPath, { encoding: null })
const dataRead = new Uint8Array(buffer)
- const witness = await generate_witness(dataRead, input)
+ const witness = await this.compiler.generate_witness(dataRead, input)
// @ts-ignore
await this.call('fileManager', 'writeFile', wasmPath.replace('.wasm', '.wtn'), witness, true)
this.internalEvents.emit('circuit_computing_witness_done')
diff --git a/apps/circuit-compiler/src/app/types/index.ts b/apps/circuit-compiler/src/app/types/index.ts
index 71e1dbfced..3b6f7a57b4 100644
--- a/apps/circuit-compiler/src/app/types/index.ts
+++ b/apps/circuit-compiler/src/app/types/index.ts
@@ -45,7 +45,7 @@ export type CompilationConfig = {
version: string
}
-export type PrimeValue = "bn128" | "bls12381" | "goldilocks"
+export type PrimeValue = "bn128" | "bls12381" | "goldilocks" | "grumpkin" | "pallas" | "vesta"
export type CompilerFeedbackProps = {
feedback: string | CompilerReport[],
@@ -76,7 +76,8 @@ export type FeedbackAlertProps = {
export type ConfigurationsProps = {
setPrimeValue: (prime: PrimeValue) => void,
- primeValue: PrimeValue
+ primeValue: PrimeValue,
+ versionValue: string
}
export type CompileOptionsProps = {
diff --git a/apps/remix-ide-e2e/src/tests/circom.test.ts b/apps/remix-ide-e2e/src/tests/circom.test.ts
index 0cad3052f3..6f57533b3e 100644
--- a/apps/remix-ide-e2e/src/tests/circom.test.ts
+++ b/apps/remix-ide-e2e/src/tests/circom.test.ts
@@ -107,7 +107,7 @@ module.exports = {
.waitForElementPresent('[data-id="circuit_feedback"]')
.waitForElementVisible('[data-id="circuit_feedback"]')
.assert.hasClass('[data-id="circuit_feedback"]', 'alert-warning')
- .waitForElementContainsText('[data-id="circuit_feedback"]', 'File circuits/simple.circom does not include pragma version. Assuming pragma version (2, 1, 5)')
+ .waitForElementContainsText('[data-id="circuit_feedback"]', 'File circuits/simple.circom does not include pragma version. Assuming pragma version (2, 1, 6)')
},
'Should hide/show warnings for compiled circuit #group4': function (browser: NightwatchBrowser) {
browser
@@ -115,7 +115,7 @@ module.exports = {
.waitForElementNotPresent('[data-id="circuit_feedback"]')
.click('[data-id="hide_circuit_warnings_checkbox_input"]')
.waitForElementVisible('[data-id="circuit_feedback"]')
- .waitForElementContainsText('[data-id="circuit_feedback"]', 'File circuits/simple.circom does not include pragma version. Assuming pragma version (2, 1, 5)')
+ .waitForElementContainsText('[data-id="circuit_feedback"]', 'File circuits/simple.circom does not include pragma version. Assuming pragma version (2, 1, 6)')
},
'Should display error for invalid circuit #group4': function (browser: NightwatchBrowser) {
browser
diff --git a/apps/remix-ide/src/app/tabs/locales/en/homeReleaseDetails.json b/apps/remix-ide/src/app/tabs/locales/en/homeReleaseDetails.json
deleted file mode 100644
index 06a2f565d7..0000000000
--- a/apps/remix-ide/src/app/tabs/locales/en/homeReleaseDetails.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "homeReleaseDetails.title": "v0.38.0 RELEASE HIGHLIGHTS",
- "homeReleaseDetails.highlight1": "Alpha release for Solidity co-pilot",
- "homeReleaseDetails.highlight2": "Define Solidity remappings in remappings.txt file",
- "homeReleaseDetails.highlight3": "Run free function for any selected environment",
- "homeReleaseDetails.highlight4": "New Circom ZKP templates: Hash Checker & Rate Limiting Nullifier",
- "homeReleaseDetails.more": "Read More"
-}
-
-
-
diff --git a/apps/remix-ide/src/app/tabs/locales/en/index.js b/apps/remix-ide/src/app/tabs/locales/en/index.js
index 7f347165db..8da7dd179f 100644
--- a/apps/remix-ide/src/app/tabs/locales/en/index.js
+++ b/apps/remix-ide/src/app/tabs/locales/en/index.js
@@ -1,7 +1,6 @@
import debuggerJson from './debugger.json';
import filePanelJson from './filePanel.json';
import homeJson from './home.json';
-import homeReleaseDetailsJson from './homeReleaseDetails.json';
import panelJson from './panel.json';
import pluginManagerJson from './pluginManager.json';
import searchJson from './search.json';
@@ -21,7 +20,6 @@ export default {
...debuggerJson,
...filePanelJson,
...homeJson,
- ...homeReleaseDetailsJson,
...panelJson,
...pluginManagerJson,
...searchJson,
diff --git a/apps/remix-ide/src/app/tabs/settings-tab.tsx b/apps/remix-ide/src/app/tabs/settings-tab.tsx
index e9a77080b7..8bbf8b2c8a 100644
--- a/apps/remix-ide/src/app/tabs/settings-tab.tsx
+++ b/apps/remix-ide/src/app/tabs/settings-tab.tsx
@@ -92,11 +92,9 @@ module.exports = class SettingsTab extends ViewPlugin {
this.config.set('settings/matomo-analytics', isChecked)
this.useMatomoAnalytics = isChecked
if (!isChecked) {
- _paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
} else {
- _paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
}
diff --git a/apps/remix-ide/src/assets/js/loader.js b/apps/remix-ide/src/assets/js/loader.js
index 5938aeaf9c..4abdfc6526 100644
--- a/apps/remix-ide/src/assets/js/loader.js
+++ b/apps/remix-ide/src/assets/js/loader.js
@@ -18,17 +18,14 @@ if (domains[window.location.hostname]) {
_paq.push(["setExcludedQueryParams", ["code","gist"]]);
_paq.push(["setExcludedReferrers", ["etherscan.io"]]);
_paq.push(['enableJSErrorTracking']);
- // require user tracking consent before processing data
- _paq.push(['requireConsent']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['enableHeartBeatTimer']);
if (!window.localStorage.getItem('config-v0.8:.remix.config') ||
(window.localStorage.getItem('config-v0.8:.remix.config') && !window.localStorage.getItem('config-v0.8:.remix.config').includes('settings/matomo-analytics'))) {
- _paq.push(['optUserOut'])
-
+ // require user tracking consent before processing data
+ _paq.push(['requireConsent']);
} else {
- _paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven'])
}
diff --git a/apps/vyper/src/app/components/WarnRemote.tsx b/apps/vyper/src/app/components/WarnRemote.tsx
index ee0d4b9422..5038b61fb9 100644
--- a/apps/vyper/src/app/components/WarnRemote.tsx
+++ b/apps/vyper/src/app/components/WarnRemote.tsx
@@ -10,7 +10,7 @@ function WarnRemoteLabel({environment}: Props) {
}
return (
- The remote compiler should only be used for testing NOT for production environments. For production, use a local compiler.
+ Do not use the remote compiler in a production environment, it is only for testing purposes. For production, use a local compiler.
)
}
diff --git a/createPRToBeta.ts b/createPRToBeta.ts
new file mode 100644
index 0000000000..98237c6545
--- /dev/null
+++ b/createPRToBeta.ts
@@ -0,0 +1,48 @@
+// This script can be used to open a PR for base branch 'remix_beta' using an existing pull request
+// Pull request number should be provided while running this script
+// It will use the reference branch same as the shared PR
+// To create a new PR, Github auth token with scope 'repo' needs to be provided
+// Command to run this script: fromPR=4369 authToken=abc123 yarn run createPRToBeta
+
+import { Octokit } from "octokit"
+
+async function createPR (prNumber, baseBranch) {
+ try {
+ if (!prNumber) throw new Error(`Please provide a PR number with 'fromPR' env variable`)
+
+ const octokit = new Octokit({
+ auth: process.env.authToken || ''
+ })
+
+ const owner = 'ethereum'
+ const repo = 'remix-project'
+
+ const prData = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
+ owner: owner,
+ repo: repo,
+ pull_number: prNumber,
+ headers: {
+ 'X-GitHub-Api-Version': '2022-11-28'
+ }
+ })
+
+ const response = await octokit.request('POST /repos/{owner}/{repo}/pulls', {
+ owner: owner,
+ repo: repo,
+ title: prData.data.title + ' (for beta)',
+ body: prData.data.body + ' (for beta)',
+ head: prData.data.head.ref,
+ base: baseBranch,
+ headers: {
+ 'X-GitHub-Api-Version': '2022-11-28'
+ }
+ })
+
+ console.log('Pull Request Created!!! See: ', response.data.html_url)
+
+ } catch (error) {
+ console.error('Error during PR creation: ', error.message)
+ }
+}
+
+createPR(process.env.fromPR, 'remix_beta')
diff --git a/gulpfile.js b/gulpfile.js
index 8347a147db..f5d0819a9f 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -5,15 +5,29 @@ const { task } = require('gulp');
const fs = require('fs');
const util = require('util');
const promisifyExec = util.promisify(require('child_process').exec);
+const axios = require('axios');
var packageJSON = require('./package.json');
/**
- * @dev Task to create git tag using version from package.json and pushing this specific tag
+ * @dev Task to create git tag using version from package.json of remix_beta branch and pushing this specific tag
*/
-task('publishTag', async function () {
- const tag = "v" + packageJSON.version
- await promisifyExec(`git tag ${tag}; git push origin ${tag}`);
+task('publishTagfromBeta', async function () {
+ try {
+ let cmdOp = await promisifyExec(`git checkout remix_beta`)
+ console.log(cmdOp.stdout)
+ cmdOp = await promisifyExec(`git pull origin remix_beta`)
+ console.log(cmdOp.stdout)
+ const betaPackageJSON = fs.readFileSync(__dirname + '/package.json', 'utf8')
+ const tag = "v" + JSON.parse(betaPackageJSON).version
+ console.log(`Creating tag ${tag} from remix_beta branch`)
+ cmdOp = await promisifyExec(`git tag ${tag}`)
+ console.log(cmdOp.stdout)
+ cmdOp = await promisifyExec(`git push --tags`)
+ console.log(cmdOp.stdout)
+ }catch(error) {
+ console.error(error)
+ }
});
/**
@@ -61,4 +75,40 @@ task('syncLibVersions', async function () {
fs.writeFileSync(__dirname + '/libs/' + lib + '/package.json', JSON.stringify(distPackageJSON, null, 2), 'utf8')
})
await Promise.resolve();
-});
\ No newline at end of file
+});
+
+async function setBranchHead(branchName, head) {
+ try {
+ console.log(`Setting ${branchName} branch head to ${head}`)
+ let cmdOp = await promisifyExec(`git checkout ${branchName}`)
+ console.log(cmdOp.stdout)
+ cmdOp = await promisifyExec(`git pull origin ${branchName}`)
+ console.log(cmdOp.stdout)
+ cmdOp = await promisifyExec(`git reset --hard ${head}`)
+ console.log(cmdOp.stdout)
+ cmdOp = await promisifyExec(`git push -f origin ${branchName}`)
+ console.log(cmdOp.stdout)
+ }catch(error) {
+ console.error(error)
+ }
+}
+
+/*
+* @dev Task to set remix_beta branch up to date with master
+*/
+task('updateBetaToMaster', async function () {
+ const masterBranchDetails = await axios.get('https://api.github.com/repos/ethereum/remix-project/branches/master')
+ const masterBranchHead = masterBranchDetails.data.commit.sha
+ await setBranchHead('remix_beta', masterBranchHead)
+ await Promise.resolve();
+});
+
+/*
+* @dev Task to set remix_live branch up to date with remix_beta
+*/
+task('updateLiveToBeta', async function () {
+ const betaBranchDetails = await axios.get('https://api.github.com/repos/ethereum/remix-project/branches/remix_beta')
+ const betaBranchHead = betaBranchDetails.data.commit.sha
+ await setBranchHead('remix_live', betaBranchHead)
+ await Promise.resolve();
+ });
\ No newline at end of file
diff --git a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx
index 59391d1e09..8148602796 100644
--- a/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx
+++ b/libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx
@@ -61,14 +61,12 @@ const MatomoDialog = (props: MatomoDialogProps) => {
const declineModal = async () => {
settings.updateMatomoAnalyticsChoice(false)
- _paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
setVisible(false)
}
const handleModalOkClick = async () => {
- _paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
settings.updateMatomoAnalyticsChoice(true)
diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
index 91b254f913..864819c62b 100644
--- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
+++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
@@ -128,7 +128,7 @@ const RemixApp = (props: IRemixAppUi) => {
break
}
case UsageTypes.Advance: {
- _paq.push(['trackEvent', 'enterDialog', 'usageType', 'tutor'])
+ _paq.push(['trackEvent', 'enterDialog', 'usageType', 'advanced'])
break
}
case UsageTypes.Prototyper: {
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx
index 4f1d72bfad..2568f88bf5 100644
--- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx
+++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx
@@ -4,6 +4,7 @@ import {FormattedMessage} from 'react-intl'
import {ThemeContext, themes} from '../themeContext'
import Carousel from 'react-multi-carousel'
import 'react-multi-carousel/lib/styles.css'
+import * as releaseDetails from './../../../../../../releaseDetails.json'
const _paq = (window._paq = window._paq || []) // eslint-disable-line
@@ -73,28 +74,26 @@ function HomeTabFeatured() {