Hans Moog 🦋 Profile picture
Aug 4 25 tweets 5 min read Twitter logo Read on Twitter
So it's finally time for part 2 of the update, in which I will explain how the reactive package allows us to merge metadata and logic to eliminate the problems discussed in the previous thread by getting rid of our 'external propagation logic'.
I will split the thread into several different segments to make it easier to associate the attached pictures with their respective text.

Since we plan to create blocks that act like 'interacting cells', we first need to create a mechanism that allows them to communicate.
For this purpose, we mimic the function of a 'receptor', which is a chemical structure on the membrane of cells that can bind to so-called 'ligands' to release a 'messenger'. Image
This is equivalent to a 'variable' that notifies others about the fact that it has been set, and we translate this into a component with the following interface: Image
- Set: Sets the value of the variable to a known value.

- Compute: Sets the value of the variable to the result of a computation.

- Get: Reads the current value of the variable.

- OnUpdate: Allows subscribers to register a function that is executed when the value changes.
The only task of this component is to hold a value and notify others about value changes, while making sure that all updates happen 'atomically' (all subscribers are notified about the current update before the next one is processed).

Note: We are optionally able to provide ...
... a 'transformation function' to each variable that can determine if and how the stored value should change in response to external stimuli.

This can, for example, be used to define variables with a trap-door condition that prevent updates after they have been set.
This is a relatively simple concept, but it is already powerful enough to implement logic by 'closing the loop' and creating a 'derived variable' that dynamically 'computes' its own value by subscribing to the updates of another variable. Image
Since the compute method runs within the locking context of the input variable, we can be 100% certain that its value will always correctly reflect the result of the defined transformation (writes become recursively atomic).

Moreover, we can derive variables not only from a ...
... single input but also from two or more by making the compute function subscribe to multiple dependencies. Image
Looking at this picture, it becomes easy to see the similarities to 'logical gates', and it becomes clear that this allows us to implement any kind of logic. Image
To simplify a common use case, we have implemented another generalized component that we call a 'counter'.

This counter keeps track of the number of times a dynamic set of input variables fulfill a certain condition.

This can, for example, be used to count the number ...
... of 'solid parents' and is a common way for components to react to their 'environment' (parents and children). Image
All the building blocks needed to implement our logic are now in place, so let's dive straight into the code of the TipManager that is the first component that is based on these concepts.

The following image represents a portion of the constructor of the TipMetadata where we ...
... initialize and define the variables and their relationships. Image
The code means quite literally what it says:

- A block is a 'strong tip' if it is a 'strong tip pool member,' and it is not 'strongly referenced by other tips.'

- A block is a 'strong tip pool member' if its tip pool is set to StrongTipPool, and it is neither 'orphaned' ...
...nor 'evicted.'

- A block is 'orphaned' if it is either 'strongly orphaned' or 'weakly orphaned.' and so on ...

Once these variables are set up, no further code is necessary to update their values.
Instead of having to write complex algorithms, we break down the logic into a set of self-contained transformation rules that can be understood in isolation, ignoring everything not immediately relevant for the property.

This massively simplifies the act of writing ...
... technical specifications as we just need to list the properties for the specs.

Each variable is only written at one line in the code, and each intermediate transformation is spelled out as the value of a reactive variable, making the algorithms inspectable.

Should we ...
... find a property with the wrong value, then either the transformation function is wrong, or one of its dependencies has the wrong value.

This allows us to directly navigate to the cause of the problem without running the network with additional debug outputs (implicit ...
... debug outputs exist at every single step of the execution).

Each property has its own mutex, so we reach maximal parallelizability and only wait if the exact same property is written twice (almost never the case and the only time where we want to wait to ensure consistency).
Variables only propagate changes in one direction (from input to output), and circular dependencies cannot be specified as we must always name all inputs when defining a variable (deadlocks become impossible).

The ability to subscribe to any property makes the logic ...
...extremely modular.

If another component wants to do something when a block gets confirmed, it simply subscribes to that variable, without needing to modify any of the existing code (components 'speak the same language').

Changing the logic is easy since everything based ...
... on a property will continue to function even if the definition of the property itself is modified, or, for example, extended by an additional condition.

Problems with erroneous cut-off conditions for the propagation are eliminated, as the propagation will automatically ...
stop once there are no longer changes to the derived variables.

TL;DR: The logic is still complex (a lot of interconnected properties are needed), but the complexity becomes 'manageable'.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Hans Moog 🦋

Hans Moog 🦋 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @hus_qy

Jan 30
@Plinz I personally think that modeling multiway systems as rewrite systems that operate on a global continuous vector of data is a bit non-intuitive (and also pretty inefficient in code as you have to essentially duplicate the entire vector for each branch that you spawn).

In the ...
@Plinz ... context of Wolframs work, I even think that it leads to questionable conclusions like the proposal to explain the wave function collapse as a Knuth–Bendix completion of the multiway graph, which fails to explain things like Schrödingers Cat where different quantum states ...
@Plinz ... can lead to vastly different macroscopic outcomes.

A slightly different take on causal multiway systems that is also closer to the way we perceive the world is to model them as an evolution of "interacting substates / particles", rather than a continuous sequence of symbols.
Read 15 tweets
Jan 20
I have lately received a number of messages, asking about the security of IOTA's new consensus mechanism in situations like network splits.

Since these questions seem to originate in factually wrong statements of a critic, I want to answer this question publicly.

(1/20)🧵👇
To understand how IOTA handles this type of situation, we first need to understand what a network split is.

It is a situation where the network is split into two (or more) disconnected partitions where each partition can only see their respective set of issued messages.

(2/20)
Most splits are the result of faulty network infrastructure causing temporary interruptions of connectivity.

Redundant hardware and connections have made large-scale network splits increasingly rare but smaller, locally confined partitions are still relatively common.

(3/20)
Read 20 tweets
Dec 29, 2022
@durerus @Conste11ation @Vrom14286662 Yes, I read their whitepaper but sadly it doesn't really contain a lot of information.

Apart from a lot of references to other papers, it contains only very hand wavy statements. I don't think they name a single concrete algorithm in the entire document.

The graphics they ...
@durerus @Conste11ation @Vrom14286662 ... show in their document are not results of their own work / simulations but are copied from this students master thesis: repository.tudelft.nl/islandora/obje…, which ends with the words: Image
@durerus @Conste11ation @Vrom14286662 It was promised that they would release updated papers and information, that would answer some of the questions I had, but I think this was delayed.

I wouldn't rule out that they work on something legit and I would give them the benefit of the doubt but everything that I ...
Read 8 tweets
Dec 9, 2022
I think it's time for a short update around our progress on coordicide:

A few weeks ago we merged the refactored consensus code base and we have been running it in an internal testnet since then.

After fixing a lot of bugs, the node looks increasingly stable (we also found ...
... the memory leak that we were fighting with for almost 2 weeks - people who closely follow the development process on github will know what I mean).

The only remaining thing for the prototype to be feature complete in a first MVP version (apart from getting rid of ...
... possible remaining bugs) is the chain switching, which allows nodes to automatically recover after i.e. having being eclipsed / in a minority partition.

Me and Andrea started working on this 2 weeks ago but we had to pause and first change the way we manage state to ...
Read 7 tweets
Nov 14, 2022
@DesheShai I would argue that the 50% attack resilience you mentioned is not the result of PoW but the result of how Satoshis voting mechanism does not operate in rounds where you have to "prematurely" finalize decisions. This allows actors to continuously adjust their opinion and ...
@DesheShai ... ultimately converge to all add weight to the same winning outcome.

If you operate in rounds (like all contemporary BFT style consensus mechanisms) and declare a decision to be final once you have reached 67% of the weight (to move on to the next round), then an attacker ...
@DesheShai ... that controls >1/3rd (i.e 34%) could switch the outcome of the voting which leads to the lowered security threshold in each round (waiting for more weight would challenge liveness).

If you do however never finalize decisions and allow actors to converge post-reaching a ...
Read 34 tweets
Nov 9, 2022
@DesheShai Btw. what we discussed is actually just going to be the pre-consensus of the entire protocol.

We decided to use PoS as a pre-consensus as it is more efficient and secure than PoW when it comes to producing agreements (you can slash attackers and so on) but the entire reason ...
@DesheShai ... why we want to enable users to issue their own blocks is because we actually want to tap into a completely new form of sybil protection for settlement that we call "social consensus" or "subjective asymmetric trust" (name tbd.) and that we believe to be superior to PoW ...
@DesheShai ... when it comes to establishing an "objective settlement security".

The idea is essentially very simple. Whenever users issue a block, they do not just attach their block to their preferred part of the DAG and therefore contribute to the decision making process but they ...
Read 20 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(