Comments (13)
Maybe I should do v1.1.4.post0
with this fix...
from python-bitcointx.
instead of v1.1.4.post0
, I'm thinking about releasing v1.1.5
just for this fix, because while it is a fix that should be put out right away, it is a breaking change for the code that depends on incorrect behavior, if such code exists somewhere.
from python-bitcointx.
I am going to release v1.1.5
with this fix shortly, unless there are objections.
@kristapsk @AdamISZ @jonasnick plz check
from python-bitcointx.
It looks JoinMarket doesn't call witness_version()
anywhere in code (checked with grep -R witness_version src/
).
from python-bitcointx.
@dgpv You could add commit with fix to some branch, then I can test JoinMarket against it, just in case.
from python-bitcointx.
While at it, I decided to change the way secp256k1 library handle and library capabilities is accessed.
This allowed the path change to take effect even if set_custom_secp256k1_path()
is called after
bitcointx.core is imported (but before any of the functions that use library handle is called)
This change too can cause breakage in the code that used secp256k1_*
variables from
bitcointx.core.secp256k1
. Three functions are introduced in this module instead:
get_secp256k1_handle()
, get_secp256k1_contexts()
and get_secp256k1capabilities()
.
Those interested in using them (which is expected to be very few), please look into the source
code of the module.
The changes (including of course the witness_version()
fix) are in the https://github.com/Simplexum/python-bitcointx/tree/fix_witness_version
If you can test this changes, that would be great
from python-bitcointx.
While at it, I decided to change the way secp256k1 library handle and library capabilities is accessed.
This allowed the path change to take effect even if
set_custom_secp256k1_path()
is called after bitcointx.core is imported (but before any of the functions that use library handle is called)This change too can cause breakage in the code that used
secp256k1_*
variables frombitcointx.core.secp256k1
. Three functions are introduced in this module instead:get_secp256k1_handle()
,get_secp256k1_contexts()
andget_secp256k1capabilities()
. Those interested in using them (which is expected to be very few), please look into the source code of the module.The changes (including of course the
witness_version()
fix) are in the https://github.com/Simplexum/python-bitcointx/tree/fix_witness_versionIf you can test this changes, that would be great
This currently breaks JoinMarket, will look at it. If others want to take a look, here's JM changes to install this branch of python-bitcointx. kristapsk/joinmarket-clientserver@2aa06a3
from python-bitcointx.
Can you tell me how it breaks ? Maybe I can adjust the code to make it more backward-compatible
from python-bitcointx.
Can you tell me how it breaks ? Maybe I can adjust the code to make it more backward-compatible
ImportError while importing test module '/home/runner/work/joinmarket-clientserver/joinmarket-clientserver/test/unified/test_segwit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
test/unified/test_segwit.py:5: in <module>
from common import make_wallets
test/unified/common.py:14: in <module>
from jmclient import open_test_wallet_maybe, BIP32Wallet, SegwitWallet, \
src/jmclient/__init__.py:4: in <module>
from .support import (calc_cj_fee, choose_sweep_orders, choose_orders,
src/jmclient/support.py:5: in <module>
from .configure import get_bondless_makers_allowance
src/jmclient/configure.py:13: in <module>
import jmbitcoin as btc
src/jmbitcoin/__init__.py:18: in <module>
from jmbitcoin.secp256k1_main import *
src/jmbitcoin/secp256k1_main.py:9: in <module>
from bitcointx.core.secp256k1 import secp256k1_context_verify
E ImportError: cannot import name 'secp256k1_context_verify' from 'bitcointx.core.secp256k1' (/home/runner/work/joinmarket-clientserver/joinmarket-clientserver/jmvenv/lib/python3.11/site-packages/bitcointx/core/secp256k1.py)
from python-bitcointx.
Ah, yes, this is the expected breakage. It seems that your project uses secp256k1 module directly. In the current code (edit: this is changed already, look in messages below), to get the library handle, you need to call get_secp256k1_handle()
, and to get the contexts, you call get_secp256k1_contexts()
, which returns the dataclass with two fields: sign
and verify
, which contain ctypes pointers to the contexts created with the library handle that get_secp256k1_handle()
returns.
I am now thinking that maybe combining this into one function is better - just return the class that will contain the handle, contexts, and capabilities together. The fact that load_secp256k1_library()
returns the handle that was not stored inside the module, while get_secp256k1_contexts()
return the contexts of the handle that was stored is inconsistent. It makes sense to combine these into one, and remove the inconsistency
I will soon update the branch with changes. Yes, there will be breakage, but this is for the better.
from python-bitcointx.
I have updated the code in fix_witness_version
branch. I have added Secp256k1
class with lib
, ctx
, cap
fields.
Please look into this commit cda4b6b to understand how to work with secp256k1 from python-bitcointx from now on.
Any comments on the changes are welcome.
from python-bitcointx.
I have released version 1.1.5 with the fixes and changes. Closing this.
from python-bitcointx.
@kristapsk I'll make a branch to update JM for the new API from this version of python-bitcointx. This only affects PoDLE calculation in secp256k1_main.py, I believe.
from python-bitcointx.
Related Issues (20)
- Can DeserializationValueBoundsError be triggered by a valid tx? HOT 6
- Taproot support HOT 18
- BIP32 test vector 5 should be added to tests and checked HOT 5
- How to handle libsecp256k1 ABI non-guarantees of stability HOT 5
- CPubKey class and invalid pubkeys - should the API be changed ?
- Potential problem with RIPEMD160 removal from newer OpenSSL versions by default HOT 2
- On MacOS-latest, openssl import fails (openssl is used for non-strict sig verification) HOT 1
- Consider adding scriptWitness to CTxIn
- sign-psbt.py example does not support electrum's testnet xpub encoding for p2wsh HOT 3
- Adding bech32 spending example HOT 4
- libbitcoinconsensus undefined symbol HOT 4
- Use libsecp256k1 v0.2.0? HOT 11
- Incompatibility with OpenSSL 3 HOT 9
- psbt.sign not support pubkey type witness_v1_taproot HOT 1
- Iibbitcoinconsensus is deprecated by Core
- secp256k1 library not found HOT 2
- Consider OP_1NEGATE handling in CScriptOp (as per linked issue from Core) HOT 1
- Issues with configure bitcointx to work with libsecp256k1 HOT 2
- tapInternalKey issue while creating the transaction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bitcointx.