-
Notifications
You must be signed in to change notification settings - Fork 523
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
feature NetworkID
#2216
feature NetworkID
#2216
Conversation
This library will already need to be updated due to the addition of 1.10.0 amendment featureXRPFees and the changes it makes to |
Yeah I agree, using the auto fill seems like the best approach. |
@dangell7 are you planning on finishing this PR yourself or are you just updating the definitions.json? |
I was waiting for |
I think they can be implemented independently (especially since this change doesn't require an amendment). |
@mvadari I have some thoughts on this. I added networkID to the autofill function. Technically in hooks amendment there is a fee endpoint that is different than However my thoughts are that the moment you are connected to the ws/rpc, you are connected with a NetworkID. The autofill adds fields to the transaction but those fields are constantly adjusting based on different inputs and the Network ID doesn't change. So does it make sense to be in autofill or should we do a Also, is networkID a |
@mvadari I made this as a second option. The sdk doesnt emit the connected message until after the server_info response is received. EDIT: Didn't like the second option. So I went with a 3rd option. Now its a function called after Ex: |
fixup add network id to server info fixture fixup! Revert "update tests and fixtures" This reverts commit a5deee1.
Regardless of the option we choose, the integration/browser tests will fail because |
This PR should not be merged in until the rippled PR is in |
Wouldn't it still fail for mainnet until the amendment was passed and all servers upgraded? I think we would need to check if the amendment is enabled before adding the |
There's no amendment, there's no change for mainnet. The only change is in testnets, and the only testnet that has this feature right now is the hooks one. So if we merge this in now, then it screws over everyone working on the Testnet or Devnet. |
I think you can change this PR so that when xrpl.js connects to a server that doesn't use a NetworkID (including Mainnet, Testnet, Devnet, etc) it doesn't set the NetworkID field. That way, it wouldn't break anything, and also doesn't need to wait for anything. |
Usage: https://github.com/Transia-RnD/xls-playground/blob/main/ts/test/networkID.test.ts
|
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.
lgtm but I think @justinr1234 should review the tests before this is merged
Co-authored-by: Mayukha Vadari <[email protected]>
const Fee = '10' | ||
const Sequence = 1432 | ||
const LastLedgerSequence = 2908734 | ||
const HOOKS_TESTNET_ID = 21338 |
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.
Is this ID set in stone and will never change?
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.
@mvadari What do you think? I can use the faucet to retrieve the ID for hooks testnet but it would make autofill a bit slower on the first call. I think the ID for each networks should remain unchanged but I might be wrong
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.
I don't think it changes, but if they switch to a v4 or something at some point then it might change then.
Perhaps a better solution is some sort of force-network-id flag? Or just tell people that if they're using the hooks testnet they'll have to add the network ID in themselves.
client.disconnect().then(() => resolve()) | ||
}) | ||
client.connect() | ||
client.on('connected', function () { |
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.
@pdp2121 what error is caused? Can you give more information?
This leads me to believe your code needs to be enhanced to handle the case where the client is disconnected after you've already called server_info --- or that when your call to server_info is ready to be made, the client could already be disconnected.
I'm curious to know the error before we call this resolved
@pdp2121 can you update with main |
High Level Overview of Change
XRPLF/rippled#4370
Context of Change
Added network id to the base transaction
Added network id to the
server_info
responseAdded network id to the binary codec
Added network id to client and modify on
client.connect()
Added network id to autofill when
rippled_version
is 1.11.0 or later or network is hooks testnetType of Change
Test Plan
No tests were written