npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

validator-gauges-manager-ts-sdk

v0.0.3

Published

Marinade Validator Gauges Manager SDK for Typescript

Downloads

6

Readme

= Validator Gauges Manager

Contract to serve as a intermediary on creation proposals for SPL Gov realms. The SPL governance contract is at: https://github.com/solana-labs/solana-program-library/tree/master/governance Marinade fork of the SPL GOV contract is at: https://github.com/marinade-finance/solana-program-library

The main reason for creation of this contract is to have an option to renew the proposal voting of validator gauges, i.e., to create the reocurance voting. The reason is the SPL GOV limitation that the votins is some end time and there is not possible to reopen same voting automatically in current version (v3.1).

== Design

The base flow consists of:

. creating a proposal template (init) . allocate more space for Solana account to be possible to fill in records of template data . adding template data records (permissionless, those are records consisting PublicKey that's used as SPL-GOV option description for a proposal) . create a proposal (the Validator Gauges Manager PDA can be named as authority of governance) . insert proposal options from template data to SPL-GOV proposal (in chunks; because of CU and memory limitations) . signing-off the proposal

Additional flow:

  • [permissionless] template data records (option template) may be added (when not in state of inserting proposal options)
  • template data records may be removed from the contract
  • when stuck in constraint of creation admin may erase constraint checks for proposal creation
  • admin account that is the only permitted to do authorized operations can be changed

== Program data structure

Accounts definition is at:./programs/validator-gauges-manager/src/state/proposal_template.rs[accounts]. Two account types are created for proposal creation:

  • account with metadata for template
  • account with template data (options used as a template) consisting of proposal option description used for SPL-GOV proposal

image::./res/validator-gauges-manager-accounts.png[]

== Constraints

  • creation of proposal template (main PDA account of Validator Gauges Manager contract) is limited one per state of Marinade liquid-staking-program
  • creation of proposal template is bound to a Realm; only Realm authority may create the proposal template account (PDA)
  • the most of the operations are permitted only for admin with exceptions of adding/removing template data records (consisting the validtor PublicKey for gauges voting), those are permissionless but it's required the validator account is part of the linked Marinade state
  • a new proposal can be created only once per epoch (within the epoch)

== Testing

The Anchor tests do not contain the Marinade liquidity-state-program and it's needed to be run without that feature.

[source,sh]

anchor test -- --no-default-features

=== Testing and typescript

At the development phase the tests uses the https://github.com/solana-labs/oyster[Oyster SDK] of governance that's forked to Marinade repository at https://github.com/marinade-finance/oyster/tree/governance-multichoice/packages/governance-sdk

The Marinade forked Oyster repo contains changes that are needed to work with the https://github.com/marinade-finance/solana-program-library[Marinade SPL GOV] contract. The package.json links the github repository and it contains Typescript. For the node_modules dependency to work it's needed to build the JS first. There is used the gitpkg.now.sh that takes repository in particular branch, it switches to a directory and creates .tgz package. Then there could be placed a postinstall script that do some building (the site places package.json scripts stuff as added in URL argument).

NOTE: yarn postinstall somehow does not work, npm is used intentionally see something at https://github.com/yarnpkg/yarn/issues/5476

To get upgraded source code from github currently I have no other idea than

[source,sh]

rm -rf /tmp/yarn-cache-tmp &&
yarn upgrade @solana/spl-governance --cache-folder /tmp/yarn-cache-tmp