This seems to be unnecessary because a ledger is hashed with its own close time and its parent's digest (which thus incorporates the parent's close time).
Why is a ledger hashed with the close time of its parent ledger?
60 Views Asked by John Freeman At
1
There are 1 best solutions below
Related Questions in XRP
- XRPL-py: asyncio.run() cannot be called from a running event loop
- Keep getting { throw new Error('Invalid API Key and/or API Secret. Use dotenv or constructor params.');}
- XRPL4J - Getting Started using Java tutorial does not match the versiomn 3.2 code - help needed
- Using BigQuery XRP transactions table to query XRP balance of an account at specific block number
- XRP send function does not work. The latest ledger sequence 36750915 is greater than the transaction's LastLedgerSequence
- How we can achieve Cross border payment based on xrp-ledger
- Fail to find an NFT via computed NFTokenPage ID as per docs on XRPL
- Is there a way to store two months of history in my Ripple testnet?
- where do xrp ledger gateways get their xrp from?
- XRPL: Check last 3 transactions only
- xrpl-accountlib - UnhandledPromiseRejectionWarning: TypeError: AddressCodec.isValidSeed is not a function
- I am unable to send custom token to other wallet on XRP Ledger
- How to handle post data in next js
- xrpl-py testnet is not a valid url
- How to set Custom Headers in xrpl.js
Related Questions in RIPPLED
- rippled SSL-Certificate
- Ripple XRP Ledger - How do I create an asset or a token? What is the transaction type that accomplishes that?
- Ripple XRP Ledger - How much data can i put in the memo field
- How can we take all ripple aka XRP accounts snapshot?
- How to run ripple v2 on local
- boost_chrono_FOUND to FALSE so package "boost_chrono" is considered to be NOT FOUND
- Generate digest/ binary blob for XRP raw transaction using rippled c++ library
- How does a component within rippled send and receive messages from peers?
- How can I debug a deadlocked rippled?
- Why is a ledger hashed with the close time of its parent ledger?
- How can I apply a transaction to a ledger?
- How can I sign a JSON transaction?
- How to get information from xrp rippled like data api v2 in localhost
- Since ripple-lib-java is unmaintained, how do you manually sign a transaction?
- xrp {"result":{"error":"noNetwork","error_code":17,"error_message":"Not synced to Ripple network.","request":{"command":"fee"},"status":"error"}}
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are transactions that need to know the current time in order to execute correctly. For example, a transaction that trades one asset for another needs to ensure it doesn't execute offers that expired.
There are really only two places you could get that time. You could get it from the previous ledger's close time or you could get it from this ledger's close time. The option I chose is to use the previous ledger's close time.
The reason for that choice is that you have to know everything that could affect a transaction result before you can start executing that transaction. Having to know a ledger's close time before you could execute any of the transactions in it would result in significant additional computational expense.
The software runs every transaction when it is received to make sure the transaction will be able to execute and claim a fee. This is necessary to prevent relaying a transaction that won't claim a fee and allowing free relaying which could lead to denial of service attacks. The more similarly the transaction runs when it executes for real, the less disk I/O and additional computation is needed. So you want to feed the same inputs to the transaction when you run it for real as when you test it. That means using the parent ledger's close time rather than the actual ledger's close time, which is not known until much later.
So given that we need the parent's close time, why do we put it in the ledger header? There really isn't a particularly good reason. In practice, you need to have the preceding ledger's header in memory to produce the next ledger anyway. However, not putting the previous ledger's close time in the header would mean that if you only had a single ledger, you wouldn't know what the effective time of the transactions was unless you looked at the previous ledger. That would make it harder to understand what rules were applied during order executions or other operations that require a time.
In summary, the decision to use the previous ledger's close time was done for sound engineering reasons primarily focused around performance in the critical path where transactions are executed "for real". But the decision to put the close time in the ledger header is really just a mild human convenience to make it easier to know what effective wall time was applied for the transactions in the ledger without having to look outside the ledger to know.