Discussions

Ask a Question
ANSWERED

Install on V2 fails

Hi, I've been trying to install my hook on V2 now for a while - to no avail. I can't even install the hook from the documentation... Debugging says: Trying to wasm instantiate proposed hook size = 711 GuardCheck Total worse-case execution count: 1 GuardCheck Total worse-case execution count: 16 GuardCheck Total worse-case execution count: 285 Trying to wasm instantiate proposed hook size = 711 In a loop until the tx fails because of the last ledger sequence. Any suggestions what could cause this behaviour?
ANSWERED

Timestamp

Hey, I was just wondering if there is a way to get the current timestamp on an incoming transaction?
ANSWERED

Flash Loans - DeFi

The way hooks operate on-chain, would it be possible to deploy a Hook that facilitates flash loans to users? Since the XRPL requires a Hook to finish executing on the same ledger it was triggered, I think it's definitely possible to deploy a flash loan provider/platform. If anyone is interested to learn more about flash loans, do read: - https://www.blocksecteam.com/papers/sbc21_flashloan.pdf
ANSWERED

Hook Chaining

Me and Denis Angell are particularly confused about the Hooks Chaining feature, maybe Richard could elaborate this feature to us? I'm wondering what the documentation means by 'remote account', is this related to the positioning of attached Hooks on the Sending and Receiving account? I'm not confident about the Sending/Receiving account being related to this feature, since on the #0 Chain position, it describes to us that the Hook on the *host* account is executed and no particular Receiving account is mentioned as well. [Most Likely Answer Below] Or is the Hook Chaining feature allowing us to position Hooks on our account by priority? Let's say I have 2 Hooks on my account, a Carbon Hook (sends a sum to a specified account) & a Firewall Hook (checks a list...), I want the Firewall Hook to be executed first before the Carbon Hook. So I specify the Firewall Hook @ Chain Position #-3 and the Carbon Hook @ Chain Position #-2 in this particular scenario. If my guess is right, then Hooks Chaining is really valuable to the amendment :) . Mindless recommendation: Rather then only allowing users to input a Hook's position by priority(#), what about XRP / IOUs amount? E.g: If payment >= 1,000,000 XRP: #1: Carbon -> #2: Firewall If payment >= 1,000 XRP: #1: Firewall -> #2: Carbon ^ Ignore the logic for now, I'm guessing it'll fail if the account is listed on a blacklist as it'll just rollback. Related doc: https://xrpl-hooks.readme.io/docs/execution-order#hook-chaining-future-feature
ANSWERED

Progress on Hooks?

Hey, I was just wondering if the Hooks amendments is being delayed or everything is going as planned? When do you guys think the Hooks Amendment is being published on the mainnet, any guesstimate? Thank you.
ANSWERED

No RPC endpoint?

I noticed there is no RPC endpoint on the hooknet. Is this your subtle way of telling me to migrate to web sockets in all my api calls to the XRPL? :) I realize I could open up one on my own, I just had some tests running that use RPC so I was curious.

Improved error messaging when hooks don't conform to the engine contract?

I'm hoping to start a discussion orbiting around the error messages that the XRPL engine is returning when someone new (like me) is fumbling through all of this. I understand that _g is required from the documentation's perspective. However the error message we get back from the engine isn't helpful for seeing this is the problem when you don't include it. For instance if we don't include _g as an import you get a "Malformed transaction" error from the XRPL engine. Not super helpful for someone "down in the weeds" trying to learn. Interestingly if you include _g but don't use it in your hook you get a "temBAD_SIGNATURE" error from the engine. Again, not super helpful because it leads you down the path of "debugging" how you signed the transaction. I wonder if it could be a more clear about the reason for the "Bad Signature"? Any thoughts?

Xumm KYC

Is there a way to add the KYC status to the ripple account? Is there a way to call an outside api though a hook? I've got a hook that can only accept a specific issuer/token but I also want this to be pinned to the KYC that is done through Xumm.. Any thoughts?

Can I use AssemblyScript?

Hi team, Do you see any issue with using https://www.assemblyscript.org/ ? I tried to compile your simple `accept` hook with AssemblyScript but when I submit the transaction with ripple-lib I get an error message: ``` data: { resultCode: 'temMALFORMED', resultMessage: 'Malformed transaction.', engine_result: 'temMALFORMED', engine_result_code: -299, engine_result_message: 'Malformed transaction.', tx_blob: '12001622800000002400441FC5201B004565333010000000000000000068400000000000000C7321031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B74473045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D7BA50061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D61708114A9E75BEA9E40D24E411DC9E5B1E209C5F015BA10', tx_json: { Account: 'rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g', CreateCode: '0061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D6170', Fee: '12', Flags: 2147483648, HookOn: '0000000000000000', LastLedgerSequence: 4547891, Sequence: 4464581, SigningPubKey: '031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B', TransactionType: 'SetHook', TxnSignature: '3045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D', hash: 'BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29' } } ``` Also in the rippled logs are showing: ``` 2021-Sep-27 10:55:29.827798400 UTC OpenLedger:TRC HookSet[rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g-BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29]: Malformed transaction. Hook attempted to specify import module other than 'env' ``` Thank you

[accept Hook] - Cannot read property 'toBytesSink' of undefined

Hi, I am learning about Hooks and I wanted to try first with something simple and the "accept" hook. I am using your code in accept.js and when I run it with "node accept.js ssXUB..." I get the following error: TypeError: Cannot read property 'toBytesSink' of undefined at BinarySerializer.writeFieldAndValue (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js:125:32) at /Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/types/st-object.js:130:19 at Array.forEach (<anonymous>) at Function.STObject.from (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/types/st-object.js:128:16) at serializeObject (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/binary.js:59:32) at signingData (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/binary.js:75:12) at Object.encodeForSigning (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/index.js:37:12) at computeSignature (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:36:41) at signWithKeypair (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:59:42) at RippleAPI.sign (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:163:16) Have you already faced this issue? Thank you