Damus
Monero Research Lab (Unofficial) profile picture
Monero Research Lab (Unofficial)
@MoneroResearchLab
The MRL discussed proposals to update the Difficulty Adjustment Algorithm (DAA) detailed in research-lab issue #165. Rough consensus formed around implementing monotonic timestamps and reducing the Future Time Limit (FTL) to 30 minutes in v17, as this is a minimal change that eases future DAA upgrades. A full DAA replacement at v17 faces opposition due to implementation scope and need for adversary testing. Points evaluated included potential miner manipulation of timestamps, edge cases with consecutive rapid blocks near the FTL, appropriate lag parameters (30 blocks vs. 10 blocks), and feasibility of implementing ASERT fixed-point arithmetic in alternative node codebases like Cuprate. Supporters of DAA changes will conduct further analysis on historical hashrate instability in CryptoNote forks and comparative selfish mining profitability.

rucknium: 5. Replace the difficulty adjustment algorithm with ASERT or WTEMA (https://github.com/monero-project/research-lab/issues/165).
sech1: I'm for the idea to improve DAA in general, but...
sech1: I have two concerns about the new DAA. First, as far as I see, the difficulty depends on the timestamp (delta from the last block) and goes down exponentially to avoid slow blocks. This creates a direct and strong incentive for miners to manipulate it. Second, when the timestamp is pushed to the +30 min limit (because of miners manipulating it),
sech1: two fast blocks can have a problem with selecting their timestamp without being rejected.
tevador: I don't really see the "incentive" as a problem. The miner faking the timestamp is reducing the difficulty for the next block and the reduction applies equally to every miner and is small and bounded by the FTL.
rucknium: I assume tevador will respond, but here's mine: Are you looking at the real time targeting (RTT) variant of ASERT? RTT does do what you say, but RTT isn't in the proposal. And the FTL is a problem now in the status quo.
sech1: If RTT is not included, then it looks solid
tevador: There may be some annoyance when looking at block explorers and seeing timestamps that are 30 minutes off, but keeping the timestamp at the FTL perpetually would need a malicious miner with a relatively high hashrate. And nothing stops the miner from doing the same thing today with +2 hour timestamps.
tevador: I don't think anyone is proposing RTT.
sech1: FTL does solve itself though, at 1 second per second pace
sech1: Second fast block that had to be pushed beyond +30 min will have to wait 1 second before broadcasting
rucknium: FWIW, zawy12 proposes a very tight FTL tolerance. Let me get his exact suggestion.
sech1: So it looks solid, but needs real testing in an adversary environment, or at least adversary simulations
tevador: I'm not sure how exactly current monerod handles blocks with timestamps too far in the future. It should not reject the block, just delay relaying it.
rucknium: "Future Time Limit (FTL) should be reduced to a fraction of block time" https://github.com/zawy12/difficulty-algorithms/issues/76
sech1: Too tight FTL is not practical
rucknium: I'm not saying I support a shorter FTL. Just showing other perspectives.
sech1: This puts entire network at the mercy of NTP servers
tevador: I think 30 minutes is a good compromise. That supports clocks up to 15 minutes off, which is something like the average annual clock drift.
rucknium: Recently, zawy12 has been invested in the idea of following some strict time consistency rules to fulfill some theoretical properties that distributed systems "should" have. Again, I'm not saying that those are adoptable ideas for Monero.
sech1: +1
rucknium: Need to install atomic clocks in Monero Nodos :D
rucknium: Like I said in the GitHub issue, I'm not convinced that lagged measurements of 30 blocks should be used.
sech1: 30 is too much
tevador: Yes, lagged measurement should be revisited. 30 blocks may be too high
tevador: Zero lag has the issue of helping selfish miners
sech1: After the fork hashrate will naturally drop, and we'll have to endure 30+ slow blocks
sech1: Why not 10? It's the tx output spend limit, so it's considered enough
rucknium: syntheticbird: I wanted to ask you if you have any thoughts about implementing ASERT vs WTEMA in cuprate. ASERT requires a workaround for the floating point computation of the exponential.
tevador: AFAIK RandomX v2 activates at v17, the new DAA would be from v18, so 720 blocks later.
sech1: ASERT does calculations in integers? Not floats
sech1: For this exact reason
tevador: Yes, BCH uses a fixed point approximation.
rucknium: Right. So is the workaround with integer computations easy to do in cuprate?
sech1: Should be easy, it's plain 64-bit operations
rucknium: Or any other alternative node implementation, of course. I assume it shouldn't be a big problem because BCH had at least 6 maintained node implementations at one time. All of them must have implemented ASERT.
tevador: Should be similar to C. I think it needs around 10-15 lines of code. WTEMA needs 1 line of code.
syntheticbird: wouldn't be the first time we hide integer shenanigans behind helpers but we try to explode cuprate-helper. and since it's scope to difficulty I don't see that much of a maintenance burden to it.
jeffro256: Might be easier since Rust has native language support for unsigned 128 bit integer arithmetic
syntheticbird: jeffro256: just don't ask for constant-time
syntheticbird: lol
jeffro256: Yeah lol. Shouldn't matter for consensus rule verification
syntheticbird: but basically we can do SomeWorkaround<Integer> and implement all the arithmetic and std::ops trait and call it a day
syntheticbird: i think
tevador: I see loose consensus to implement monotonic timestamps and 30 minute FTL from v17. The DAA change has opposition.
rucknium: I think it's the job of the DAA change supporters, including me, to present a more convincing case that it's needed in the FCMP hard fork.
rucknium: I will see if I can get useful info about why some of the unnamed Monero/Cryptonote forks blew up because of their DAA. And maybe see if I can compare selfish mining revenue with the current DAA and ASERT/WTEMA.
rbrunner: I only ever heard about coins with difficulties that had relatively low total hashrate, for what it's worth
rucknium: Maybe the own- and cross-elasticities could be somehow estimated based on historical data of those old forks.
rucknium: rbrunner: Yes. Being a minority hashpower chain in a given hash algorithm makes it worse. I mean, increases the total elasticity of hashpower with respect to the block reward, which makes things less stable and prone to osciallations.
rucknium: But if your own-elasticity is high enough, you can get into trouble too.
tevador: Most CN clones had issues with profit switching miners that would rapidly mine a lot of blocks before the difficulty starts rising and then abandon the chain. The current DAA takes at least 75 blocks to react.
ofrnxmr: Maybe happened/happens to wow?
sech1: Most small coins had to adapt to huge hashrate swings, this is not the case for Monero
rucknium: It's not true for now, but it could change.
rucknium: Zephyr Protocol made up a big share of total RandomX hashpower at one point in time.
rucknium: I think it was Zephyr at least. IIRC, ofrnxmr was following the developments.
tevador: Qubic was a hashrate spike
rbrunner: Yes, I think we had a time where Zephyr was considerably more profitable to mine than Monero
rucknium: I may see if zawy12 want to comment on it. He's still actively engaging with the subject, based on GitHub comments.
rbrunner: Quickly checked, this is their current hashrate: 30.084 MH/s
rbrunner: (If really directly comparable of course ...)
https://libera.monerologs.net/monero-research-lab/20261202#c725566
❤️1