Page MenuHomePhabricator
Feed Advanced Search

Sep 5 2023

emack closed D14423: [mock-chronik-client] Add module to monorepo.
Sep 5 2023, 13:06
emack committed rABC9fbe3a8d720f: [mock-chronik-client] Add module to monorepo (authored by emack).
[mock-chronik-client] Add module to monorepo
Sep 5 2023, 13:06

Sep 4 2023

emack added a comment to D14269: [Chronik-client] - Cycle through backup instances on outage.

@bytesofman, @tobias_ruck - ready for your follow up review following Fabien's acceptance, pls see updated summary for reference on this refactored state.

Sep 4 2023, 09:03
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Re-ordering unit test public function

Sep 4 2023, 08:33
emack updated the summary of D14269: [Chronik-client] - Cycle through backup instances on outage.
Sep 4 2023, 08:26
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.
  • Moved FailoverProxy and the Endpoint interface into its own file failoverProxy.ts
  • The Endpoint interface is only used within failoverProxy.ts hence not declared as an export
Sep 4 2023, 08:26
emack added inline comments to D14269: [Chronik-client] - Cycle through backup instances on outage.
Sep 4 2023, 07:59
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Responding to feedback

Sep 4 2023, 07:59
emack updated the summary of D14269: [Chronik-client] - Cycle through backup instances on outage.
Sep 4 2023, 03:51
emack added inline comments to D14269: [Chronik-client] - Cycle through backup instances on outage.
Sep 4 2023, 03:49
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Responding to feedback

Sep 4 2023, 03:48

Sep 2 2023

emack updated the summary of D14269: [Chronik-client] - Cycle through backup instances on outage.
Sep 2 2023, 13:15
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.
  • Renamed Proxy interface to Endpoint to reflect it having regular and ws endpoints
  • Renamed FailoverProxy class to Proxy
  • Dropped underscore in _get and _post
Sep 2 2023, 00:49

Sep 1 2023

emack added inline comments to D14423: [mock-chronik-client] Add module to monorepo.
Sep 1 2023, 00:50
emack updated the diff for D14423: [mock-chronik-client] Add module to monorepo.

Updated mock API calls to async

Sep 1 2023, 00:50

Aug 31 2023

emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.
  • Moved _post, _get, _request and _callAxios into the FailoverProxy class.
  • Created a new connectWs() function in FailoverProxy and originally tried passing WsEndpoint._connect() to it as a callback function param, however none of the internal WsEndpoint variables carried over causing all kinds of issues. Instead, I moved the logic from WsEndpoint._connect() into FailoverProxy.connectWs(), passing this as an input param so everything it needs is accessible from execution within FailoverProxy.
  • ScriptEndpoint now takes in FailoverProxy as an input param rather than a ChronikClient instance.
  • Removed moveWorkingIndexToFront() function and corresponding unit tests.
  • I also looked into making a separate diff for FailoverProxy as per earlier suggestion but the fact that it needs the cycling refactor makes it not that much different to this current diff.
Aug 31 2023, 16:22

Aug 30 2023

emack updated the diff for D14423: [mock-chronik-client] Add module to monorepo.

Removed script error mocks

Aug 30 2023, 23:52
emack updated the diff for D14423: [mock-chronik-client] Add module to monorepo.
  • Added tests to mock API errors for utxos(), history() and script().
  • Updated package.json
Aug 30 2023, 15:14
emack updated the diff for D14423: [mock-chronik-client] Add module to monorepo.
  • Removed npm installation instructions in README. Kept package.json as it's needed for the unit test suite and potential inclusion in CI.
  • Renamed chronikMock.js to index.js, and chronikMock.test.js to index.test.js
  • Updated apps/examples/sendXec.test.js to use this chronik mock to show script(), utxos() and broadcastTx() endpoints working fine. Couldn't use ecash-coinselect as an example because its current state in master does not make API calls.
Aug 30 2023, 01:29

Aug 29 2023

emack requested review of D14269: [Chronik-client] - Cycle through backup instances on outage.

Comment below for discussion.

Aug 29 2023, 14:54
emack abandoned D14418: [ecash-coinselect] Add chronikMock.
Aug 29 2023, 09:38
emack requested review of D14423: [mock-chronik-client] Add module to monorepo.
Aug 29 2023, 09:22

Aug 28 2023

emack added a comment to D14418: [ecash-coinselect] Add chronikMock.

Note: the corresponding unit tests for this mock will be added to D14417 as that diff introduces chronik utxo api calls to the library. This mock is separated out into its own diff to minimize the size of D14417.

Aug 28 2023, 13:04
emack planned changes to D14417: [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts.

Waiting on D14418 to land

Aug 28 2023, 12:57
emack updated the diff for D14417: [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts.

Added ecashaddjr to package.json

Aug 28 2023, 12:56
emack requested review of D14418: [ecash-coinselect] Add chronikMock.
Aug 28 2023, 12:50
emack planned changes to D14417: [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts.

@TODO: need to add ChronikMock in a separate diff in order to mock the chronik.script().utxos() api call within getInputUtxos().

Aug 28 2023, 12:28
emack updated the diff for D14417: [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts.
  • Renamed the existing getInputUtxos() function into getP2pkhInputUtxos(), along with README and commenting updates to make it clear this function ONLY takes in p2pkh utxos. Similarly updated mock names to reflect this.
  • Added new 'getInputUtxos() function that is similar to getP2pkhInputUtxos() except it takes in an eCash address, converts it to hash160 and makes the chronik.script(type, hash).utxos()` call directly before parsing the result.
  • Due to the similarity between getP2pkhInputUtxos() and 'getInputUtxos(), the common logic has been moved into a new function called collectXecUtxos()`.
  • @TODO: need to add ChronikMock in a separate diff in order to mock the chronik.script().utxos() api call within getInputUtxos().
Aug 28 2023, 12:28

Aug 27 2023

emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Added cycling logic which can be summarized as:

  • When ChronikClient._request() or WsEndpoint._connect() successfully connects to a regular or ws endpoint, its index in the proxy array is passed to FailoverProxy's moveWorkingIndexToFront() function which moves that element to the front of the array so that it will be used first at the next connection attempt.
  • Since each element contains a pairing of the regular url endpoint and its wsUrl equivalent, cycling through the array will always ensure both endpoint types are synchronized.
  • Added unit tests for appendWsUrls, FailoverProxy instance and moveWorkingIndexToFront().
Aug 27 2023, 10:51

Aug 26 2023

emack planned changes to D14269: [Chronik-client] - Cycle through backup instances on outage.
Aug 26 2023, 15:01
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

(Incremental update - still work in progress)

Aug 26 2023, 15:01
emack added a comment to D14269: [Chronik-client] - Cycle through backup instances on outage.

Just for info, current thinking on the proposed FailoverProxy class.

Aug 26 2023, 04:38
emack requested review of D14417: [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts.
Aug 26 2023, 01:08
emack closed D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 26 2023, 00:39
emack committed rABC79fbb4329daf: [ecash-coinselect] Fix byte count calculation logic (authored by emack).
[ecash-coinselect] Fix byte count calculation logic
Aug 26 2023, 00:39
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Rebased to master

Aug 26 2023, 00:00

Aug 25 2023

emack retitled D14380: [ecash-coinselect] Fix byte count calculation logic from [ecash-coinselect] Update getInputUtxos to support custom outputs and OP_RETURN bytecounts to [ecash-coinselect] Fix byte count calculation logic.
Aug 25 2023, 14:46
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Backed out OP_RETURN related logic, leaving only the bytecount calculation fixes

Aug 25 2023, 14:45
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Added isWithinByteCountRange function

Aug 25 2023, 13:53
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Updated unit tests to reflect byte size calculations

Aug 25 2023, 12:06
emack requested review of D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 25 2023, 02:57

Aug 24 2023

emack added inline comments to D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 24 2023, 14:53
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Responding to feedback

Aug 24 2023, 14:53
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Updated README

Aug 24 2023, 01:33

Aug 23 2023

emack added inline comments to D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 23 2023, 15:27
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Responding to feedback

Aug 23 2023, 15:27
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Fixed typo

Aug 23 2023, 02:22
emack updated the summary of D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 23 2023, 02:16
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Added contextual comments around:

  • Max outputs per tx and its corresponding varint encoding
  • Max inputs per tx and its corresponding varint encoding
  • ECDSA signature breakdown and the smallest valid scriptSig
  • Min and max OP_RETURN output sizes
Aug 23 2023, 02:15

Aug 22 2023

emack added a comment to D14380: [ecash-coinselect] Fix byte count calculation logic.

Updated constants in P2PKH_OUT_SIZE and FRAMEWORK_BYTES calculations to factor in whether outputs and inputs are less than 253 which uses 1 byte for storage length, or >= 253 which uses 3 bytes for storage length.

What about larger var ints ?

Aug 22 2023, 14:23
emack updated the diff for D14380: [ecash-coinselect] Fix byte count calculation logic.

Updated constants in P2PKH_OUT_SIZE and FRAMEWORK_BYTES calculations to factor in whether outputs and inputs are less than 253 which uses 1 byte for storage length, or >= 253 which uses 3 bytes for storage length.

Aug 22 2023, 14:12
emack requested review of D14380: [ecash-coinselect] Fix byte count calculation logic.

What is your source ?

I got it from https://bitcointalk.org/index.php?topic=4429991.0

Aug 22 2023, 11:41
emack added a comment to D14380: [ecash-coinselect] Fix byte count calculation logic.

@Fabien ping

Aug 22 2023, 07:53
emack added inline comments to D14269: [Chronik-client] - Cycle through backup instances on outage.
Aug 22 2023, 07:51
emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Responding to feedback

Aug 22 2023, 07:51

Aug 17 2023

emack added a comment to D14380: [ecash-coinselect] Fix byte count calculation logic.

The output count is not limited to 252

So is it basically the max possible amount of outputs in a single tx multiplied by the locking script size?

Aug 17 2023, 13:37

Aug 16 2023

emack added a comment to D14380: [ecash-coinselect] Fix byte count calculation logic.

Do you mean the variable-length integer encoding the locking script's size is not 1 byte?

Yes: https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer

Aug 16 2023, 08:49
emack added a comment to D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

You should unit test getInputUtxos with the new changes, better in its own diff. I can already spot a bug related to varint encoding in calcByteCount so there might be more.

Aug 16 2023, 02:45
emack requested review of D14380: [ecash-coinselect] Fix byte count calculation logic.
Aug 16 2023, 02:39

Aug 15 2023

emack requested review of D14269: [Chronik-client] - Cycle through backup instances on outage.

Is it OK to subscribe to some backend ws but use another of for the regular endpoints?

@tobias_ruck - this can technically be done but would it be advisable based on how you designed this client?

Aug 15 2023, 08:45
emack accepted D14379: [Cashtab] Deprecating ticker.js.
Aug 15 2023, 04:59
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebased to master

Aug 15 2023, 04:40
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Updated function comments

Aug 15 2023, 04:34
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebase to master

Aug 15 2023, 04:30
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Updated bytecount logic

Aug 15 2023, 04:29
emack added inline comments to D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.
Aug 15 2023, 03:56
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Updated getSlpInputUtxos to calculate the OP_RETURN script as a Buffer, and then calls getInputUtxos using the length of this Buffer. The resulting txFee calculation now factors in the OP_RETURN bytecount.
Note: the slpMdm library is what's used by Cashtab to generate OP_RETURN scripts as well.

Aug 15 2023, 03:56

Aug 13 2023

emack updated the diff for D14269: [Chronik-client] - Cycle through backup instances on outage.

Removed the try/catch in _connect() and instead updated the onerror callback to close the websocket., which results in the loop cycling to the next url in this._wsUrls.

Aug 13 2023, 10:20
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebase

Aug 13 2023, 03:57
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Responding to feedback

Aug 13 2023, 03:57
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Updated to use .isNeg()

Aug 13 2023, 03:27
emack added a comment to D14376: [Cashtab][Alias] Pending Aliases.

should actually go in wallet state

Will wait to see the decision around potentially moving pending logic to alias-server before making this change

Aug 13 2023, 03:21
emack updated the diff for D14376: [Cashtab][Alias] Pending Aliases.
  • Fixed cashtabCache refresh trigger dependency by also updating the cashtabCache state variable in useWallet, which now successfully refreshes the Alias.js component on new alias registrations and changes to pending aliases list
  • Added notification on successful or unsuccessful alias registeration in useWallet's pendingAliasCheck function
Aug 13 2023, 03:19
emack updated the summary of D14376: [Cashtab][Alias] Pending Aliases.
Aug 13 2023, 02:41

Aug 12 2023

emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebase

Aug 12 2023, 15:32
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Rebase

Aug 12 2023, 15:31
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Removed debugging statement

Aug 12 2023, 15:30
emack added inline comments to D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.
Aug 12 2023, 15:21
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Responding to feedback

Aug 12 2023, 15:21
emack requested review of D14376: [Cashtab][Alias] Pending Aliases.
Aug 12 2023, 13:28
emack closed D14334: [Cashtab][Alias] Upgrade Alias UI.
Aug 12 2023, 09:31
emack committed rABCe43d81ba0711: [Cashtab][Alias] Upgrade Alias UI (authored by emack).
[Cashtab][Alias] Upgrade Alias UI
Aug 12 2023, 09:31
emack abandoned D14356: [Cashtab][Alias] Track pending aliases.

I think this diff needs to be rebuilt with a simpler approach.

Aug 12 2023, 09:23

Aug 11 2023

emack abandoned D14353: [ecash-coinselect] [SLP] Part 3/3 - Add support for token burn transactions.

Looks like this got inadvertently merged into part 2 - D14352 when rebasing to changes from part 1

Aug 11 2023, 14:48
emack closed D14198: [Apps][Examples] Sending XECs.
Aug 11 2023, 14:33
emack committed rABC2f3d77d9adbf: [Apps][Examples] Sending XECs (authored by emack).
[Apps][Examples] Sending XECs
Aug 11 2023, 14:33
emack updated the diff for D14198: [Apps][Examples] Sending XECs.

Updated usage instructions

Aug 11 2023, 14:32
emack retitled D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions from [ecash-coinselect] [SLP] Part 2/3 - Add support for token genesis transactions to [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.
Aug 11 2023, 14:22
emack retitled D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions from [ecash-coinselect] [SLP] Part 1/3 - Add SLP utxo selection algo for token send transactions to [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.
Aug 11 2023, 14:21
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Updated README

Aug 11 2023, 14:21
emack planned changes to D14353: [ecash-coinselect] [SLP] Part 3/3 - Add support for token burn transactions.

Looks like this got inadvertently merged into part 2 - D14352 when rebasing to changes from part 1

Aug 11 2023, 14:18
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebased to changes in part 1

Aug 11 2023, 14:14
emack updated the diff for D14352: [ecash-coinselect] [SLP] Part 2/2 - Add support for token genesis and burn transactions.

Rebased to changes in part 1

Aug 11 2023, 14:00
emack updated the diff for D14351: [ecash-coinselect] [SLP] Part 1/2 - Add SLP utxo selection algo for token send transactions.

Updated SLP quantities to use bn.js

Aug 11 2023, 13:57
emack added a comment to D14356: [Cashtab][Alias] Track pending aliases.

Note: the logic to trigger notification on successful and unsuccessful registrations will be done in a separate diff to help with ease of reviewing this diff.

Aug 11 2023, 09:07
emack added inline comments to D14356: [Cashtab][Alias] Track pending aliases.
Aug 11 2023, 08:59
emack updated the diff for D14356: [Cashtab][Alias] Track pending aliases.

Updated comments

Aug 11 2023, 08:39
emack added inline comments to D14356: [Cashtab][Alias] Track pending aliases.
Aug 11 2023, 08:35
emack updated the diff for D14356: [Cashtab][Alias] Track pending aliases.

Responding to feedback

Aug 11 2023, 08:35
emack added a comment to D14356: [Cashtab][Alias] Track pending aliases.
  • red: registered by someone else
Aug 11 2023, 01:47