-
Notifications
You must be signed in to change notification settings - Fork 118
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
Merge main into v2 #1873
Merged
Merged
Merge main into v2 #1873
Changes from 108 commits
Commits
Show all changes
109 commits
Select commit
Hold shift + click to select a range
c1e8d6e
add missing exports
mitschabaude c142de6
first pass
45930 89f774a
progress
45930 45a0fca
error in transfer function
45930 b106b5d
sloppy version working
45930 d37fcc0
Update mina version
volhovm 6c4ec79
Regenerate bindings
volhovm d0eeee2
rm log lines, add multi-instance test
45930 a445be2
better names and descriptions
45930 1feb7b4
small cleanups
45930 a6ad3a5
Merge branch 'main' into 2024-09-refactor-offchain-state
45930 4674be6
point to bindings
Trivo25 b062cc5
Merge pull request #1835 from o1-labs/volhovm/arkworks024-regression-…
volhovm bf0e09e
demo the cleaner API
45930 dfce473
split out feature flags and proof into their own files
mitschabaude e5f0bf4
Merge branch 'feature/type-exports' into feature/provable-proofs
mitschabaude 6017d63
prune imports
mitschabaude e255dcb
Merge pull request #1846 from o1-labs/feature/provable-proofs
mitschabaude 4884e10
attach .provable to proof
mitschabaude 1d2111f
add unit test
mitschabaude 2c54719
minor unit test change
mitschabaude a10e6dc
remove special-casing between proofs and other types
mitschabaude 8a4038d
store proofs and others in a single list
mitschabaude 3e17207
adapt method interface in unit test
mitschabaude c6ba3c3
fix getting prev proofs
mitschabaude b63cb7b
improve error feedback in zkapp test runner for proving errors
mitschabaude 5277324
Merge pull request #1847 from o1-labs/feature/provable-proofs-2
mitschabaude af307e1
simplification 1: don't store proofs in separate list
mitschabaude 8037bb0
simplification 2: remove isProof flag
mitschabaude 29e1448
unit tests
mitschabaude c978754
Added method to retrieve dummy VerificationKey
rpanic c661f69
we can filter proofs from values, without types
mitschabaude 05e4c26
recursively extract proofs
mitschabaude 6007f63
add changelog
Trivo25 8ceca5e
initialize bindings
Trivo25 ca9bb88
replace occurrence of old dummy vk
Trivo25 0f9525f
extract nested proof inputs in pickles rule
mitschabaude 9d4a17e
unit test for nested proof extraction
mitschabaude 27b07d5
test recursive proving (negative + positive)
mitschabaude cb09374
achieve proper intellisense
mitschabaude 0df8bcd
negative test for > max proofs
mitschabaude 0cd022d
Merge pull request #1852 from rpanic/rpanic/expose-dummy-vk
Trivo25 055aab3
expose extremely useful utility method
mitschabaude 8bfbaab
remove some mini-abstractions that are only used once
mitschabaude 480cfc2
unrelated: enable detecting struct at runtime
mitschabaude 3616cc8
changelog
mitschabaude a140dfa
Merge branch 'main' into feature/provable-proofs-3
mitschabaude ea19655
remove unused method
mitschabaude 59a6c58
Merge pull request #1851 from o1-labs/feature/provable-proofs-3
mitschabaude 7e1cdd3
Fixed fetch() behaviour in regards to custom token contracts
rpanic 4df6e36
Update bindings for safe lagrange basis
mrmr1993 67b3e38
Fix typechecking of main
mrmr1993 66f9c64
add unit test of fix
45930 fdcb8b6
export a few utility types
mitschabaude 80fcc08
expose arrayGet
mitschabaude d75cf6c
Update CHANGELOG.md
Trivo25 2635545
expose bytes base class
mitschabaude 0f8ff81
Merge pull request #1853 from rpanic/fix/state-fetch-token
Trivo25 a27a6ca
improve packed
mitschabaude 6bcbdf7
mapValue
mitschabaude 9e539b5
nice value type for packed
mitschabaude 90a8822
fixup
mitschabaude 7b62ad1
expose sha2 padding and fix input mutation in compression
mitschabaude 0384736
export tupleN
mitschabaude 8e3ac5e
uint32 to./from bytes
mitschabaude ecc4b03
remove duplication
mitschabaude ee52796
handle out of bounds
mitschabaude 46e7a8c
update mina and bindings
45930 d057138
revert type changes
45930 3bbb4f9
updated changelog
45930 d5994ba
1.8.1
actions-user b4d22e7
Update CHANGELOG for new version v1.8.1
actions-user f15293a
Merge pull request #1857 from o1-labs/feature/fix-compilation-of-main
45930 ceaa80f
Merge branch 'main' into release/v1.8.1
Trivo25 85a650f
fix version
Trivo25 aa37fd9
bump playwright
Trivo25 dd5e6a1
Merge pull request #1866 from o1-labs/fix-ci-playwright
Trivo25 39be181
Merge branch 'main' into release/v1.8.1
Trivo25 a0900ae
Merge pull request #1865 from o1-labs/release/v1.8.1
Trivo25 a40b888
create changelog workflow
Trivo25 70b22cd
Merge pull request #1867 from o1-labs/force-changelog-entry
Trivo25 97e5130
Merge pull request #1860 from zksecurity/feature/provable-proofs-4
Trivo25 57642f2
Merge branch 'main' into 2024-09-refactor-offchain-state
45930 78a23d7
PR comments
45930 1219a26
undelete changelog!
45930 ef3f7f8
refactor test file into directory
45930 f5a3f1d
Merge pull request #1834 from o1-labs/2024-09-refactor-offchain-state
45930 6f50045
include the type OffchainStateInstance in the internal API
b4847d2
rm nonsense
fc16ce3
Merge pull request #1871 from o1-labs/2024-10-fix-offchain-state-typing
45930 17c658f
Merge branch 'main' into merge-main-v2-1
Trivo25 5eb9bcb
fix test
Trivo25 33b7c6a
update changelog; remove deprecated functions; replace with new ones;…
Trivo25 8e8cf88
fix getUnconstrained
Trivo25 da665b0
dump vk
Trivo25 95d1b1b
build fix for lagrange basis performance
fa3e1ef
adding a unit test
7958bda
updating changelog and adding comment to unit test
44eb218
Merge pull request #1874 from o1-labs/2024-10-bugfix-lb-performance
45930 7e93948
update package json
45930 c56ba60
release 1.9.1
45930 3f26345
Merge branch 'main' into merge-main-v2-1
Trivo25 9145722
changelog
Trivo25 ad774e1
Merge pull request #1880 from o1-labs/release/v1.9.1
45930 50c52b5
bindngs
Trivo25 212f778
fix test
Trivo25 26442a9
Merge branch 'main' into merge-main-v2-1
Trivo25 fde3f0c
merge changelog
Trivo25 cd20ace
typo
Trivo25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Check Changelog for changes | ||
on: | ||
pull_request: | ||
types: [assigned, opened, synchronize, reopened, labeled, unlabeled] | ||
branches: | ||
- main | ||
jobs: | ||
Check-Changelog: | ||
name: Check Changelog Action | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: tarides/changelog-check-action@v2 | ||
with: | ||
changelog: CHANGELOG.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule bindings
updated
11 files
+100,746 −100,763 | compiled/node_bindings/o1js_node.bc.cjs | |
+1 −1 | compiled/node_bindings/o1js_node.bc.map | |
+1,747 −1,746 | compiled/node_bindings/plonk_wasm.cjs | |
+594 −594 | compiled/node_bindings/plonk_wasm.d.cts | |
+ − | compiled/node_bindings/plonk_wasm_bg.wasm | |
+418 −418 | compiled/node_bindings/plonk_wasm_bg.wasm.d.ts | |
+435,378 −2,011 | compiled/web_bindings/o1js_web.bc.js | |
+1,529 −1,529 | compiled/web_bindings/plonk_wasm.d.ts | |
+1,987 −1,986 | compiled/web_bindings/plonk_wasm.js | |
+ − | compiled/web_bindings/plonk_wasm_bg.wasm | |
+363 −363 | compiled/web_bindings/plonk_wasm_bg.wasm.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,32 @@ | ||
import assert from 'assert'; | ||
import { | ||
Encryption, | ||
Encoding, | ||
Bytes, | ||
PrivateKey, | ||
Provable, | ||
initializeBindings, | ||
Encryption, | ||
Encoding, | ||
} from 'o1js'; | ||
|
||
await initializeBindings(); | ||
|
||
// generate keys | ||
let privateKey = PrivateKey.random(); | ||
let publicKey = privateKey.toPublicKey(); | ||
|
||
// message | ||
let message = 'This is a secret.'; | ||
let messageFields = Encoding.stringToFields(message); | ||
|
||
// encrypt | ||
let cipherText = Encryption.encrypt(messageFields, publicKey); | ||
|
||
// decrypt | ||
let decryptedFields = Encryption.decrypt(cipherText, privateKey); | ||
let decryptedMessage = Encoding.stringFromFields(decryptedFields); | ||
|
||
if (decryptedMessage !== message) throw Error('decryption failed'); | ||
console.log(`Original message: "${message}"`); | ||
console.log(`Recovered message: "${decryptedMessage}"`); | ||
|
||
// the same but in a checked computation | ||
|
||
await Provable.runAndCheck(() => { | ||
// encrypt | ||
let cipherText = Encryption.encrypt(messageFields, publicKey); | ||
|
||
// decrypt | ||
let decryptedFields = Encryption.decrypt(cipherText, privateKey); | ||
|
||
messageFields.forEach((m, i) => { | ||
m.assertEquals(decryptedFields[i]); | ||
}); | ||
}); | ||
|
||
// With a longer message | ||
message = JSON.stringify({ | ||
coinbase: { | ||
btc: 40000.0, | ||
eth: 3000.0, | ||
usdc: 1.0, | ||
ada: 1.02, | ||
avax: 70.43, | ||
mina: 2.13, | ||
}, | ||
binance: { | ||
btc: 39999.0, | ||
eth: 3001.0, | ||
usdc: 1.01, | ||
ada: 0.99, | ||
avax: 70.21, | ||
mina: 2.07, | ||
}, | ||
}); | ||
messageFields = Encoding.stringToFields(message); | ||
|
||
// encrypt | ||
cipherText = Encryption.encrypt(messageFields, publicKey); | ||
|
||
// decrypt | ||
decryptedFields = Encryption.decrypt(cipherText, privateKey); | ||
decryptedMessage = Encoding.stringFromFields(decryptedFields); | ||
|
||
if (decryptedMessage !== message) throw Error('decryption failed'); | ||
console.log(`Original message: "${message}"`); | ||
console.log(`Recovered message: "${decryptedMessage}"`); | ||
|
||
// the same but in a checked computation | ||
class Bytes256 extends Bytes(256) {} | ||
const priv = PrivateKey.random(); | ||
const pub = priv.toPublicKey(); | ||
|
||
await Provable.runAndCheck(() => { | ||
// encrypt | ||
let cipherText = Encryption.encrypt(messageFields, publicKey); | ||
const plainMsg = 'The quick brown fox jumped over the angry dog.'; | ||
|
||
// decrypt | ||
let decryptedFields = Encryption.decrypt(cipherText, privateKey); | ||
console.log('en/decryption of field elements'); | ||
const cipher2 = Encryption.encrypt(Encoding.stringToFields(plainMsg), pub); | ||
const plainText2 = Encryption.decrypt(cipher2, priv); | ||
|
||
messageFields.forEach((m, i) => { | ||
m.assertEquals(decryptedFields[i]); | ||
}); | ||
}); | ||
assert( | ||
Encoding.stringFromFields(plainText2) === plainMsg, | ||
'Plain message and decrypted message are the same' | ||
); | ||
|
||
console.log('everything works!'); | ||
console.log('en/decryption of bytes'); | ||
const message = Bytes256.fromString(plainMsg); | ||
console.log('plain message', plainMsg); | ||
const cipher = Encryption.encryptBytes(message, pub); | ||
const plainText = Encryption.decryptBytes(cipher, priv); | ||
console.log('decrypted message', Buffer.from(plainText.toBytes()).toString()); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NIT]
I think this compare should use
7e9394
as the base, rather thanf15293a69
which comes from v1.9.0There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Still need to shuffle commits around, I'll pick the final commit in a separate release PR