# Dual Governance

## Building on top of the Isolated Storage

#### We learned that DataStore keeps different entities in isolated storage slots with different IDs.&#x20;

However, this functionality is nothing to be excited about without a mechanism to enforce this logic on protocol and contract upgrades.

#### Geode manages crucial parts of it's operation with 2 step verification:

1. Governance Proposals
2. Senate Approvals

This setup creates another safeguard for the users of The Staking Library.

## Proposals

A proposal is Geode Governance offering a change within the protocol to the Senate.&#x20;

Every proposals isolates an ID for DataStore.

After the Controller is chosen, no one else can touch to the given storage ID.

<figure><img src="/files/Kid7sGQI2BPLVNvtZwiw" alt=""><figcaption></figcaption></figure>

{% code title="GeodeUtilsLib.sol" %}

```solidity
  struct Proposal {
    address CONTROLLER;
    uint256 TYPE;
    bytes NAME;
    uint256 deadline;
  }
```

{% endcode %}

A Proposal has 4 parameters:

* **TYPE**: separates the proposals and related functionality between different ID types.
* **NAME**:important for ID generation through `DataStore.generateId()`
* **CONTROLLER**: the address that refers to the change that is proposed by given proposal ID.&#x20;
  * &#x20;This slot can refer to the controller of an id, a new implementation contract, a new Senate etc.
* **deadline**: refers to last timestamp until a proposal expires.

{% hint style="info" %}
All TYPEs are reserved as `ID_TYPE` within  [`globals.sol`](/developers/live-contracts/ethereum-v2/portal.sol/globals.sol.md)`.`
{% endhint %}

#### **There can be more TYPE reservations in the future.**

<table><thead><tr><th width="120">ID_TYPE</th><th>CONTROLLER</th></tr></thead><tbody><tr><td>0</td><td><mark style="background-color:red;">NONE -unused</mark></td></tr><tr><td>1</td><td><mark style="color:green;">new senate address</mark></td></tr><tr><td>2</td><td><mark style="color:blue;">new implementation contract for Portal</mark></td></tr><tr><td>3</td><td><mark style="background-color:red;">GAP - unused</mark></td></tr><tr><td>4</td><td><mark style="color:green;">Controller of a Operator</mark></td></tr><tr><td>5</td><td><mark style="color:purple;">Controller of a Pool</mark></td></tr><tr><td>21</td><td><mark style="color:blue;">Module: Withdrawal Contracts</mark></td></tr><tr><td>31</td><td><mark style="color:blue;">Module: gETH interfaces</mark></td></tr><tr><td>41</td><td><mark style="color:blue;">Module: Liquidity Pool</mark></td></tr><tr><td>42</td><td><mark style="color:blue;">Module: Liquidity Pool Token</mark></td></tr></tbody></table>

### Governance

Currently, Governance is an internal ERC-20 token that is only owned by Geode Finance Developers and Treasury.

This internal ownership is a needed step to eliminate the risk of some attacks like Governance tak-over.

In the future, the Governance of Geode is supposed to be decentralized with the distribution of these tokens.

### Senate

Currently, Senate is a Multisig of Geode developers.&#x20;

But GeodeUtils Library includes a logic for changing the Senate, as well as an Election for it.

TYPE 1 proposals stand for Senate Elections.

However, the future of Senate will not be decided by elections, but with an other approach:

#### A Decentralized Senate with a weighted vote distribution:

{% content-ref url="/pages/BuwGF9OGVcDub71pHNXi" %}
[Quadratic Weighted Senate (DRAFT)](/key-concepts/future-of-geode/further-decentralization/quadratic-weighted-senate-draft.md)
{% endcontent-ref %}

### Limited Upgradability

*TYPE 2* proposals ensure Limited Upgradability on both Portal and Withdrawal Contracts.

{% content-ref url="/pages/L3X2sxZ3SIUb60lPc3zN" %}
[Limited Upgradability](/key-concepts/portal/limited-upgradability.md)
{% endcontent-ref %}

### Onboarding Operators

*TYPE 4* proposals stands for onboarding a new Node Operator to the Marketplace:

page link

### New Withdrawal Contract, gETH interface or Liquidity Pools

Other *TYPEs* like *21, 31* etc. stands for other important parameters of Portal like default Liquidity Pool or withdrawal Contract implementation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.geode.fi/key-concepts/portal/dual-governance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
