Skip to content

Commit f119743

Browse files
authored
Merge branch 'master' into matamo_ai_update
2 parents 2472b01 + 9342856 commit f119743

File tree

29 files changed

+175
-110
lines changed

29 files changed

+175
-110
lines changed

apps/circuit-compiler/src/app/actions/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const computeWitness = async (plugin: CircomPluginClient, appState: AppSt
3333
const writePath = extractParentFromKey(appState.filePath) + `/.bin/${fileName.replace('.circom', '_js')}/${fileName.replace('.circom', '.wtn.json')}`
3434

3535
await plugin.call('fileManager', 'writeFile', writePath, JSON.stringify(wtnsJson, null, 2))
36-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'computeWitness', name: 'wtns.exportJson', value: writePath, isClick: true })
36+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'compiler.generate_witness', name: 'wtns.exportJson', value: writePath, isClick: true })
3737
}
3838
} else {
3939
console.log('Existing witness computation in progress')
@@ -62,46 +62,46 @@ export const runSetupAndExport = async (plugin: CircomPluginClient, appState: Ap
6262
const zkey_final = { type: "mem" }
6363

6464
if (appState.provingScheme === 'groth16') {
65-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'provingScheme', value: 'groth16', isClick: true })
65+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'provingScheme', value: 'groth16', isClick: true })
6666
await snarkjs.zKey.newZKey(r1cs, ptau_final, zkey_final, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
6767
const vKey = await snarkjs.zKey.exportVerificationKey(zkey_final, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
6868

6969
if (appState.exportVerificationKey) {
7070
await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/keys/verification_key.json`, JSON.stringify(vKey, null, 2))
71-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'zKey.exportVerificationKey', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/keys/verification_key.json`, isClick: true })
71+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'zKey.exportVerificationKey', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/keys/verification_key.json`, isClick: true })
7272
}
7373
if (appState.exportVerificationContract) {
7474
const templates = { groth16: GROTH16_VERIFIER }
7575
const solidityContract = await snarkjs.zKey.exportSolidityVerifier(zkey_final, templates, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
7676

7777
await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/build/zk_verifier.sol`, solidityContract)
78-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'zKey.exportSolidityVerifier', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/build/zk_verifier.sol`, isClick: true })
78+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'zKey.exportSolidityVerifier', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/build/zk_verifier.sol`, isClick: true })
7979
}
8080
dispatch({ type: 'SET_ZKEY', payload: zkey_final })
8181
dispatch({ type: 'SET_VERIFICATION_KEY', payload: vKey })
8282
} else if (appState.provingScheme === 'plonk') {
83-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'provingScheme', value: 'plonk', isClick: true })
83+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'provingScheme', value: 'plonk', isClick: true })
8484
await snarkjs.plonk.setup(r1cs, ptau_final, zkey_final, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
8585
const vKey = await snarkjs.zKey.exportVerificationKey(zkey_final, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
8686

8787
if (appState.exportVerificationKey) {
8888
await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/keys/verification_key.json`, JSON.stringify(vKey, null, 2))
89-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'zKey.exportVerificationKey', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/keys/verification_key.json`, isClick: true })
89+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'zKey.exportVerificationKey', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/keys/verification_key.json`, isClick: true })
9090
}
9191
if (appState.exportVerificationContract) {
9292
const templates = { plonk: PLONK_VERIFIER }
9393
const solidityContract = await snarkjs.zKey.exportSolidityVerifier(zkey_final, templates, zkLogger(plugin, dispatch, 'SET_SETUP_EXPORT_FEEDBACK'))
9494

9595
await plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/build/zk_verifier.sol`, solidityContract)
96-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'zKey.exportSolidityVerifier', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/build/zk_verifier.sol`, isClick: true })
96+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'zKey.exportSolidityVerifier', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/build/zk_verifier.sol`, isClick: true })
9797
}
9898
dispatch({ type: 'SET_ZKEY', payload: zkey_final })
9999
dispatch({ type: 'SET_VERIFICATION_KEY', payload: vKey })
100100
}
101101
dispatch({ type: 'SET_COMPILER_STATUS', payload: 'idle' })
102102
dispatch({ type: 'SET_SETUP_EXPORT_STATUS', payload: 'done' })
103103
} catch (e) {
104-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'runSetupAndExport', name: 'error', value: e.message, isClick: true })
104+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'runSetupAndExport', name: 'error', value: e.message, isClick: true })
105105
dispatch({ type: 'SET_COMPILER_STATUS', payload: 'errored' })
106106
console.error(e)
107107
}
@@ -133,25 +133,25 @@ export const generateProof = async (plugin: CircomPluginClient, appState: AppSta
133133

134134
plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/build/proof.json`, JSON.stringify(proof, null, 2))
135135
plugin.call('terminal', 'log', { type: 'log', value: 'zk proof validity ' + verified })
136-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'generateProof', name: 'groth16.prove', value: verified, isClick: true })
136+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'generateProof', name: 'groth16.prove', value: verified, isClick: true })
137137
if (appState.exportVerifierCalldata) {
138138
const calldata = await snarkjs.groth16.exportSolidityCallData(proof, publicSignals)
139139

140140
plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/groth16/zk/build/verifierCalldata.json`, calldata)
141-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'generateProof', name: 'groth16.exportSolidityCallData', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/build/verifierCalldata.json`, isClick: true })
141+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'generateProof', name: 'groth16.exportSolidityCallData', value: `${extractParentFromKey(appState.filePath)}/groth16/zk/build/verifierCalldata.json`, isClick: true })
142142
}
143143
} else if (appState.provingScheme === 'plonk') {
144144
const { proof, publicSignals } = await snarkjs.plonk.prove(zkey_final, wtns, zkLogger(plugin, dispatch, 'SET_PROOF_FEEDBACK'))
145145
const verified = await snarkjs.plonk.verify(vKey, publicSignals, proof, zkLogger(plugin, dispatch, 'SET_PROOF_FEEDBACK'))
146146

147147
plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/build/proof.json`, JSON.stringify(proof, null, 2))
148148
plugin.call('terminal', 'log', { type: 'log', value: 'zk proof validity ' + verified })
149-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'generateProof', name: 'plonk.prove', value: verified, isClick: true })
149+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'generateProof', name: 'plonk.prove', value: verified, isClick: true })
150150
if (appState.exportVerifierCalldata) {
151151
const calldata = await snarkjs.plonk.exportSolidityCallData(proof, publicSignals)
152152

153153
plugin.call('fileManager', 'writeFile', `${extractParentFromKey(appState.filePath)}/plonk/zk/build/verifierCalldata.json`, calldata)
154-
trackMatomoEvent(plugin, { category: 'circuitCompiler', action: 'generateProof', name: 'plonk.exportSolidityCallData', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/build/verifierCalldata.json`, isClick: true })
154+
trackMatomoEvent(plugin, { category: 'circuit-compiler', action: 'generateProof', name: 'plonk.exportSolidityCallData', value: `${extractParentFromKey(appState.filePath)}/plonk/zk/build/verifierCalldata.json`, isClick: true })
155155
}
156156
}
157157
dispatch({ type: 'SET_COMPILER_STATUS', payload: 'idle' })

apps/circuit-compiler/src/app/services/circomPluginClient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class CircomPluginClient extends PluginClient {
171171
const circuitErrors = circuitApi.report()
172172

173173
this.logCompilerReport(circuitErrors)
174-
trackMatomoEvent(this, { category: 'circuitCompiler', action: 'compile', name: 'Compilation failed', isClick: true })
174+
trackMatomoEvent(this, { category: 'circuit-compiler', action: 'compile', name: 'Compilation failed', isClick: true })
175175
throw new Error(circuitErrors)
176176
} else {
177177
this.lastCompiledFile = path
@@ -200,7 +200,7 @@ export class CircomPluginClient extends PluginClient {
200200
this.internalEvents.emit('circuit_parsing_done', parseErrors, filePathToId)
201201
this.emit('statusChanged', { key: 'succeed', title: 'circuit compiled successfully', type: 'success' })
202202
}
203-
trackMatomoEvent(this, { category: 'circuitCompiler', action: 'compile', name: 'Compilation successful', isClick: true })
203+
trackMatomoEvent(this, { category: 'circuit-compiler', action: 'compile', name: 'Compilation successful', isClick: true })
204204
circuitApi.log().map(log => {
205205
log && this.call('terminal', 'log', { type: 'log', value: log })
206206
})
@@ -282,15 +282,15 @@ export class CircomPluginClient extends PluginClient {
282282
const r1csErrors = r1csApi.report()
283283

284284
this.logCompilerReport(r1csErrors)
285-
trackMatomoEvent(this, { category: 'circuitCompiler', action: 'generateR1cs', name: 'R1CS Generation failed', isClick: true })
285+
trackMatomoEvent(this, { category: 'circuit-compiler', action: 'generateR1cs', name: 'R1CS Generation failed', isClick: true })
286286
throw new Error(r1csErrors)
287287
} else {
288288
const fileName = extractNameFromKey(path)
289289
const writePath = extractParentFromKey(path) + "/.bin/" + fileName.replace('.circom', '.r1cs')
290290

291291
// @ts-ignore
292292
await this.call('fileManager', 'writeFile', writePath, r1csProgram, true)
293-
trackMatomoEvent(this, { category: 'circuitCompiler', action: 'generateR1cs', name: 'R1CS Generation successful', isClick: true })
293+
trackMatomoEvent(this, { category: 'circuit-compiler', action: 'generateR1cs', name: 'R1CS Generation successful', isClick: true })
294294
r1csApi.log().map(log => {
295295
log && this.call('terminal', 'log', { type: 'log', value: log })
296296
})
@@ -338,7 +338,7 @@ export class CircomPluginClient extends PluginClient {
338338
const witness = this.compiler ? await this.compiler.generate_witness(dataRead, input) : await generate_witness(dataRead, input)
339339
// @ts-ignore
340340
await this.call('fileManager', 'writeFile', wasmPath.replace('.wasm', '.wtn'), witness, { encoding: null })
341-
trackMatomoEvent(this, { category: 'circuitCompiler', action: 'computeWitness', name: wasmPath.replace('.wasm', '.wtn'), isClick: true })
341+
trackMatomoEvent(this, { category: 'circuit-compiler', action: 'compiler.generate_witness', name: wasmPath.replace('.wasm', '.wtn'), isClick: true })
342342
this.internalEvents.emit('circuit_computing_witness_done')
343343
this.emit('statusChanged', { key: 'succeed', title: 'witness computed successfully', type: 'success' })
344344
return witness

apps/learneth/src/redux/models/remixide.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Model: ModelType = {
6969
return
7070
}
7171

72-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'displayFile', name: `${(step && step.name)}/${path}`, isClick: true })
72+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'display_file', name: `${(step && step.name)}/${path}`, isClick: true })
7373

7474
toast.info(`loading ${path} into IDE`)
7575
yield put({
@@ -96,7 +96,7 @@ const Model: ModelType = {
9696
})
9797
toast.dismiss()
9898
} catch (error) {
99-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'displayFileError', name: error.message, isClick: false })
99+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'display_file_error', name: error.message, isClick: false })
100100
toast.dismiss()
101101
toast.error('File could not be loaded. Please try again.')
102102
yield put({
@@ -146,7 +146,7 @@ const Model: ModelType = {
146146
type: 'remixide/save',
147147
payload: { errors: ['Compiler failed to test this file']},
148148
});
149-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'testStepError', name: 'Compiler failed to test this file', isClick: false })
149+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'test_step_error', name: 'Compiler failed to test this file', isClick: false })
150150
} else {
151151
const success = result.totalFailing === 0;
152152
if (success) {
@@ -162,14 +162,14 @@ const Model: ModelType = {
162162
},
163163
})
164164
}
165-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'testStep', name: String(success), isClick: true })
165+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'test_step', name: String(success), isClick: true })
166166
}
167167
} catch (err) {
168168
yield put({
169169
type: 'remixide/save',
170170
payload: { errors: [String(err)]},
171171
});
172-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'testStepError', name: String(err), isClick: false })
172+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'test_step_error', name: String(err), isClick: false })
173173
}
174174
yield put({
175175
type: 'loading/save',
@@ -199,13 +199,13 @@ const Model: ModelType = {
199199
yield remixClient.call('fileManager', 'setFile', path, content)
200200
yield remixClient.call('fileManager', 'switchFile', `${path}`);
201201

202-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'showAnswer', name: path, isClick: true })
202+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'show_answer', name: path, isClick: true })
203203
} catch (err) {
204204
yield put({
205205
type: 'remixide/save',
206206
payload: { errors: [String(err)]},
207207
});
208-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'showAnswerError', name: err.message, isClick: false })
208+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'show_answer_error', name: err.message, isClick: false })
209209
}
210210

211211
toast.dismiss()
@@ -219,7 +219,7 @@ const Model: ModelType = {
219219
*testSolidityCompiler(_, { put, select }) {
220220
try {
221221
yield remixClient.call('solidity', 'getCompilationResult');
222-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'testSolidityCompiler', isClick: true })
222+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'test_solidity_compiler', isClick: true })
223223
} catch (err) {
224224
const errors = yield select((state) => state.remixide.errors)
225225
yield put({
@@ -228,7 +228,7 @@ const Model: ModelType = {
228228
errors: [...errors, "The `Solidity Compiler` is not yet activated.<br>Please activate it using the `SOLIDITY` button in the `Featured Plugins` section of the homepage.<img class='img-thumbnail mt-3' src='assets/activatesolidity.png'>"],
229229
},
230230
});
231-
trackMatomoEvent(remixClient, { category: 'learneth', action: 'testSolidityCompilerError', name: err.message, isClick: false })
231+
trackMatomoEvent(remixClient, { category: 'learneth', action: 'test_solidity_compiler_error', name: err.message, isClick: false })
232232
}
233233
}
234234
},

apps/remix-ide/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ class AppComponent {
685685
if (callDetails.length > 1) {
686686
this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`)
687687
// @todo(remove the timeout when activatePlugin is on 0.3.0)
688-
this.track({ category: 'App', action: 'queryParamsCalls', name: this.params.call, isClick: false })
688+
this.track({ category: 'App', action: 'queryParams-calls', name: this.params.call, isClick: false })
689689
//@ts-ignore
690690
await this.appManager.call(...callDetails).catch(console.error)
691691
}
@@ -696,7 +696,7 @@ class AppComponent {
696696

697697
// call all functions in the list, one after the other
698698
for (const call of calls) {
699-
this.track({ category: 'App', action: 'queryParamsCalls', name: call, isClick: false })
699+
this.track({ category: 'App', action: 'queryParams-calls', name: call, isClick: false })
700700
const callDetails = call.split('//')
701701
if (callDetails.length > 1) {
702702
this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`)

apps/remix-ide/src/app/components/preload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const Preload = (props: PreloadProps) => {
6969
setShowDownloader(false)
7070
const fsUtility = new fileSystemUtility()
7171
const migrationResult = await fsUtility.migrate(localStorageFileSystem.current, remixIndexedDB.current)
72-
trackMatomoEvent?.({ category: 'migrate', action: 'result', name: migrationResult ? 'success' : 'fail', isClick: false })
72+
trackMatomoEvent?.({ category: 'Migrate', action: 'result', name: migrationResult ? 'success' : 'fail', isClick: false })
7373
await setFileSystems()
7474
}
7575

apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ export class fileSystemUtility {
3939
console.log('file migration successful')
4040
return true
4141
} else {
42-
track({ category: 'migrate', action: 'error', name: 'hash mismatch', isClick: false })
42+
track({ category: 'Migrate', action: 'error', name: 'hash mismatch', isClick: false })
4343
console.log('file migration failed falling back to ' + fsFrom.name)
4444
fsTo.loaded = false
4545
return false
4646
}
4747
} catch (err) {
4848
console.log(err)
49-
track({ category: 'migrate', action: 'error', name: err && err.message, isClick: false })
49+
track({ category: 'Migrate', action: 'error', name: err && err.message, isClick: false })
5050
console.log('file migration failed falling back to ' + fsFrom.name)
5151
fsTo.loaded = false
5252
return false

apps/remix-ide/src/app/plugins/remix-ai-assistant.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ export class RemixAIAssistant extends ViewPlugin {
102102
}
103103

104104
async handleActivity(type: string, payload: any) {
105-
// Use the proper type-safe tracking helper with RemixAI events
105+
// Never log user prompts - only track the activity type
106+
const eventName = type === 'promptSend' ? 'remixai-assistant-promptSend' : `remixai-assistant-${type}-${payload}`;
106107
trackMatomoEvent(this, { category: 'ai', action: 'chatting', name: `${type}-${payload}`, isClick: true })
107108
}
108109

apps/remix-ide/src/app/plugins/solidity-script.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class SolidityScript extends Plugin {
1818
}
1919

2020
async execute(path: string, functionName: string = 'run') {
21-
trackMatomoEvent(this, { category: 'solidityScript', action: 'execute', name: 'script', isClick: true })
21+
trackMatomoEvent(this, { category: 'SolidityScript', action: 'execute', name: 'script', isClick: true })
2222
this.call('terminal', 'log', `Running free function '${functionName}' from ${path}...`)
2323
let content = await this.call('fileManager', 'readFile', path)
2424
const params = await this.call('solidity', 'getCompilerQueryParameters')

0 commit comments

Comments
 (0)