How Specifically Does Pangolin's On-Chain Governance Work?

Hi everyone,

I’m somewhat new to smart contract development and was hoping this thread could answer some questions I have as to what is meant by “on-chain governance”, both in the context of Pangolin and more generally across Avalanche. Specifically, I’m hoping someone can detail the flow for how changes are proposed, developed, voted upon, and then ultimately merged into the Pangolin smart contract(s).

To illustrate this, I think it would help to walk through an example of how Pangolin would (for example) implement a change to the vesting schedule for liquidity mining. (Again, I’m not actually proposing this, I just need an example).

To the best of my understanding, this flow would look something like the following:

  1. Proposal: I create a post in this forum with the Proposal Discussion tag in which I suggest a modification to the vesting schedule. The community debates the idea and ultimately decides to put it up for a vote.
  2. Development: I create a pull request on Github to update the Pangolin smart contract to reflect the change to the vesting schedule that I’m proposing.
  3. Voting: The pull request is voted upon in a “Yea” or “Nea” vote (how? where?) by PNG holders and the side that has more total PNG behind it wins.
  4. Contract Update: The contract is updated to reflect the change to the vesting schedule (again, how? and by whom?).

I’ve already alluded to some of my confusion, but I guess my most concrete questions are:

  1. Where and how is voting done? Since governance is done “on-chain” I assume that the votes (and the PNG placed behind each vote) are recorded on-chain somehow, but I don’t understand technically how this is done? Is there some sort of special transaction that allows users to sign the transaction with their vote from an address holding a certain amount of PNG, which is used to tally votes on the blockchain? Basically I’m kind of clueless as to how a vote on a proposal is included in a block on the Avalanche blockchain.
  2. Once a change is voted upon, how does the Pangolin smart contract update on the blockchain to reflect the outcome of the vote? Is the updated contract put on-chain at some new address, which everyone agrees to migrate to if the vote passes to modify the contract? Or do the voters simply trust the owners of the Pangolin smart contract to follow the outcome of the vote and update the contract on their own?
  3. Who gets to propose changes? And how do these proposals make it onto the blockchain to be put up for a vote? Do devs peruse this forum and decide which ideas to put up for a vote? Or is anyone able to put an idea up for a vote on the blockchain?
  4. Slightly less salient, but I guess it’s also worth asking what the exact ordering of the proposal, development, and voting stages should be. For example, should someone have already put up a PR against the Pangolin repo on Github before proposing their change (i.e. development → proposal → voting)? Are changes developed after being voted upon in the abstract (i.e. proposal → voting → development)? This last ordering makes the least sense to me because I assume that if everything is being recorded on-chain, then the outcome of the vote should directly trigger an update to the smart contract which would not be possible if that update hasn’t been developed yet.

I apologize for writing this brick of a post, but I think that kicking of a discussion that clarifies some of these questions will be beneficial for everyone – particularly developers (and enthusiasts) like myself who are less familiar with how smart contract updates are voted upon and implemented.