This version is compatible with 960f8d139940fa0814d3fac44da9a2975642f5d3
of clvm
- The type of
None
is nowundefined
(Previously it wasnull
) - Removed
isSExp()
andisCLVMObject()
since these don't exist in the Python'sclvm
and they brought slightly different behaviour. run_program()
has been deprecated. Userun_chia_program
orrun_clvm
instead.
Note:run_program()
is still available, but it cannot handle new CHIP-0011 operators likesecp256k1_verify
.
- Now
op_div
does not accept negative operands. convert_atom_to_bytes()
now is able to convert an object which hastoBytes()
method.SExp
can be initialized fromLazyNode
ofclvm_wasm
(Rust version ofclvm
)- Upgraded
bls-signatures
to2.0.3
- Upgraded npm dev dependencies
- Replaced
yarn.lock
withpnpm-lock.yaml
- Added
clvm_rs
(clvm_wasm
) support- Exposed
run_chia_program
- Exposed
run_clvm
- Exposed
LazyNode
- Added
toJSON()
method toLazyNode
(This is not implemented inclvm_wasm
)
- Added
- Exposed
Flag
- Exposed
serialized_length
- Exposed
node_from_bytes
- Exposed
- Added
asUint8Array()
method toStream
- Added
toJSON()
method toBytes
- Added
toJSON()
method toSExp
- Added tests
- Added example code
- Loading
blsjs.wasm
into a web browser from ESModule code requires to put the wasm file into url's root path.
For example, when the main (compiled) js file is loaded by
<script type='module' src="https://xxx.yyy.zzz/aaa/bbb/ccc/main.js"></script>
blsjs.wasm
will be fetched fromhttps://xxx.yyy.zzz/blsjs.wasm
.
This is module context only. if the main js file is not on module context like
<script defer src="https://xxx.yyy.zzz/aaa/bbb/ccc/main.js"></script>
,
blsjs.wasm
will be fetched fromhttps://xxx.yyy.zzz/aaa/bbb/ccc/blsjs.wasm
.
However, with clvm >= 3.0.0, most of bls operations run inside clvm_wasm_bg.wasm.
So I believe you don't need to loadblsjs.wasm
in most cases.
This version is compatible with 480b32840c525e17b5ab2f29036c033febaae71e
of clvm
- Changed error message format if argument of
x
is a single atom.
For example, when you run(x (q . 2000))
, output will be
(Prev)FAIL: clvm raise (2000)
=> (Now)FAIL: clvm raise 2000
This version is compatible with fc73cd9dc2fc30a1fd461d0f05af9f9679e042c8
of clvm
The behaviour of op_div
has changed. See detailed explanation here
- Made
op_div
bug-compatible withclvm_rs
- Replaced npm package
@chiamine/bls-signatures
withbls-signatures
This version is compatible with 389efa3fbe65c77600da63c78d29c0866d292754
of clvm
- Fixed an issue of
as_javascript
with tuples inside tuples and ending with 0
This version is compatible with 2722c78ddb92f067c5025196f397e4d2955f9053
of clvm
- Fixed typo in error message
- Fixed an issue where
op_substr
did not work as expected. - Fixed an issue where cost calculation for
op_subtract
was not correct. - Fixed
limbs_for_int
return wrong value when argument is0
. - Fixed an issue where
Bytes
comparison returns wrong result in some cases. - Fixed an issue where
op_softfork
crashed with argument atom larger than or equal to 53bit. - Fixed G1Element error message.
This version is compatible with 2722c78ddb92f067c5025196f397e4d2955f9053
of clvm
- Added type declaration file
browser/index.d.ts
on build.
- Changed SExp/CLVMObject properties
atom
andpair
to readonly to prevent potential bug. - Changed
src/__bls_signatures__.ts
location tosrc/__bls_signatures__/index.ts
to prepare for future wasm-loading tweaks. - Upgraded
@chiamine/bls-signatures
to 0.2.1-beta.2. - Use
CLVMType
instead ofCLVMObject
as a valid type representation ofCLVMObject
.
(CLVMObject should not be used as a type because there might be number of type incompatibility due to new private field) Replace**
operator onBigInt
by user-defined function because babel or some transpiler always converts**
toMath.pow
which cannot be used withBigInt
- Although I tried this, it turns out to be 100x slower than
**
operator, so I gave up. It is required to disable such a transform by end-developer. See detail here
- Although I tried this, it turns out to be 100x slower than
This version is compatible with 2722c78ddb92f067c5025196f397e4d2955f9053
of clvm
- Improved
bigint_from_bytes
around 3-10 times faster. - Improved
int_from_bytes
performance. - Improved
bigint_to_bytes
around 2 times faster. - Improved
int_to_bytes
performance.
- Fixed an issue where utility function
division
/modulo
returned wrong values in some cases.
- Added
divmod
utility function.
This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366
of clvm
- Fixed an issue where
op_lsh
did not work as expected.
This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366
of clvm
- Fixed an issue where
int_from_bytes
andbigint_from_bytes
returned always signed int/bigint. - Fixed an issue where
int_to_bytes
andbigint_to_bytes
blindly recognized the argument as a signed int/bigint.
This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366
of clvm
- Fixed an issue where
op_logand
,op_logior
,op_logxor
did not work - Fixed an issue where result of div/mod against negative
bigint
was not compatible with originalclvm
This version is compatible with 1a5cb17895d8707f784a85180bc97d3c6ebe71a0
of clvm
- Fixed an issue where
op_pubkey_for_exp
was missing. - Fixed an issue where arithmetic op of atoms larger than 32 bit integer did not work.
- Added
bigint_to_bytes
function insrc/casts.ts
- Added tests for Bytes-BigInt conversion.
This version is compatible with 1a5cb17895d8707f784a85180bc97d3c6ebe71a0
of clvm
- Improved
Stream::read
performance by removing extra memory copy.
This version is compatible with 1a5cb17895d8707f784a85180bc97d3c6ebe71a0
of clvm
- Removed
.dist
folder from git.- This folder made it harder to check diffs between versions.
- Added GitHub Action
- Added
str()
,repr()
utility functions. - Added
Bytes::subarray
to get bytes data without additional memory allocation/copy.
- Updated README.md
- Changed method name
Bytes::get_byte_at
toBytes::at
(Breaking change).
- Deprecated python specific type definition such as
str
,int
. Usestring
,number
instead.
There are 2 breaking changes.
-
Changed
OperatorDict
arguments format.
Past:OperatorDict(atom_op_function_map, quote_atom, apply_atom, unknown_op_handler)
New:OperatorDict(atom_op_function_map, option)
whereoption
is{quote_atom: Bytes, apply_atom: Bytes, unknown_op_handler: typeof default_unknown_op}
-
When you initialize
Bytes
using constructor likenew Byte(data)
,data
is not copied but just stored and keeps reference ofdata
, for performance enhancement.
In javascript, byte copy byTypedArray
constructor is not sufficiently fast.
So I left user an option how to initializeBytes
instance. Data copy, or Store reference.
If you want to copy data and cut reference apart, then please getBytes
instance byBytes.from
factory function.
Resolved a deep tree performance issue
Before this version, yarn test serialize_test --testNamePattern=test_very_deep_tree
was really slow. It took around 80 seconds to complete test.
At this version, I've managed to improve test complete time to 79s
-> 2s
by pre-allocating buffer memory on Stream
instance.
- Changed
OperatorDict
arguments format. - When you initialize
Bytes
using constructor likenew Byte(data)
,data
is not copied but just stored and keeps reference ofdata
, for performance enhancement. - Greatly improved overall performance by pre-allocating buffer memory on
Stream
instance. - Improved performance of
Bytes::equal_to
. - Changed parameter type of
SExp::equal_to
fromCastableType
toany
- Replaced use of
instanceof
operator for non-native types. - Updated bls-signatures version to 0.2.1-beta.1
- Improved
Bytes::concat
performance. - Reorganized dist folder
- Fixed an issue where
SExp.to(<boolean>)
did not work the same as python's clvm. - Fixed an issue where Bytes-SExp comparison like
b('aaa').equal_to(SExp.null())
did not work. - Fixed an issue where
OperatorDict
did not throw Error when eitherquote
orapply
is not specified.
- Added
list()
function working similar to Python'slist()
. - Added
Bytes::repeat
function.
- Fixed an issue where
int_to_bytes
did not work as expected if the argument is a negative number. - Changed
Bytes::toString()
to return python'sbytes.__repr__
style string.
- Updated
jscrypto
version to 1.0.2
- Added license information to README.md
- Fixed a bug in
sexp_from_stream
- Fixed incorrect use of
int_to_bytes
- Fixed a bug in
pre_build.js
- Changed new line style for files in
dist/
from windows-style(CR) to linux-style(LF).
- Removed
WordArray32
from possible argument ofBytes.from
.
- Added
Bytes.SHA256()
.
Bytes.from()
now accepts an array of number.
- Fixed an issue where
int_to_bytes
returns value incompatible with clvm in python. - Fixed a minor issue
- Don't remove leading '00' or 'ff' when serializing SExp to hex string.
- Fixed an issue where
SExp.to(0)
is converted toSExp(0x00)
whereSExp(0x80)
is expected. - Fixed an issue where it raises an Error when executing
Bytes::equal_to(None)
. - Fixed a minor issue
- Made
EvalError::_sexp
public.
- Added
h(<str>)
helper function which equals toBytes.from(<str>, "hex")
- Removed type-guard from
SExp::listp()
- Removed
SExpAsAtom
type andSExpAsPair
type as they seem not working.
- Added
Bytes::hex()
which is an alias ofBytes::toString()
- Added
Bytes::decode()
- Added
Bytes::startswith()
andBytes::endswith()
- Added
SExpAsAtom
type andSExpAsPair
type. - Added hex string support to
b(<str>)
. Inb("0xaa", "hex")
,0xaa
is now parsed as hex string.
- Fixed value of
SExp.TRUE
andSExp.FALSE
- Added
b(<str>)
helper function which equals toBytes.from(<str>, "utf8")
- Added
isTuple
,isList
functions.
- Made return type of
as_javascript()
explicit - Updated
CastableType
- Fixed an issue where
SExp::as_javascript()
does not return expected value. - Fixed an issue where
SExp.to(<tuple>)
raises unexpected Error. - Fixed incorrect function name
__repl__
to__repr__
- Removed '0x' prefix from results of
SExp::__repr__()
- Fixed an issue where
SExp.to(<str>)
falls in infinite loop.
- Changed source of
bls-signatures
to@chiamine/bls-signatures
- When installing from previous
Chia-Mine/bls-signatures#npm
, the npm module version is too old or unstable.
Sometimes it installed the latest commit and another time installed old cache.
I decided to install the module not from GitHub branch but official npm registry for stability.
- When installing from previous
- Updated README
- Fixed various eslint errors
- Added
to_sexp_f
export to index.ts/index.js
- Change tuple type
Tuple2
->Tuple
.
0.0.1 - 2021-06-16
- Fixed various bugs
0.0.0 - 2021-06-15
Initial (beta) release.