-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sequencer): integrate connect oracle and vote extension logic #1236
Conversation
…er of injected txs
@@ -119,13 +119,31 @@ | |||
{{- if $index }},{{- end }} | |||
{{ include "sequencer.address" $value }} | |||
{{- end }} | |||
] | |||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Should move under else statement marking genesis changes.
{{- if not .Values.global.dev }} | ||
{{- else }} | ||
{{- end}} | ||
}, | ||
"chain_id": "{{ .Values.genesis.chainId }}", | ||
"consensus_params": { | ||
"abci": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should move under else statement, marking breaking changes. You will have to add the closure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this breaking since it's not adding a new value? what's the correct syntax for this? do i move the whole consensus_params
block into the else statement?
@@ -73,7 +73,10 @@ data: | |||
OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.sequencer.otel.otlpHeaders }}" | |||
OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.sequencer.otel.traceHeaders }}" | |||
OTEL_SERVICE_NAME: "{{ tpl .Values.sequencer.otel.serviceName . }}" | |||
ASTRIA_SEQUENCER_CONNECT_GRPC_ADDR: "http://127.0.0.1:8081" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this value be configurable, at least the port?
Also should move new env vars to else statement.
@@ -73,7 +73,10 @@ data: | |||
OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.sequencer.otel.otlpHeaders }}" | |||
OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.sequencer.otel.traceHeaders }}" | |||
OTEL_SERVICE_NAME: "{{ tpl .Values.sequencer.otel.serviceName . }}" | |||
ASTRIA_SEQUENCER_CONNECT_GRPC_ADDR: "http://127.0.0.1:8081" | |||
ASTRIA_SEQUENCER_ORACLE_CLIENT_TIMEOUT_MILLISECONDS: "1000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here for configurable values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should move values to mark breaking changes and have new values configurable with value file instead of constants in configmap.
…GRPC_ADDR, increment next_currency_pair_id in put_price_for_currency_pair
Summary
integrate skip's connect (formerly named
slinky
) oracle service into astria.at a high level, connect consists of an oracle sidecar program, which interacts with a validator node to provide price data, and various cosmos-sdk modules.
since astria isn't cosmos, the relevant cosmos modules (x/marketmap and x/oracle) were essentially ported into the
connect
module of the sequencer app, which consists of two components,market_map
andoracle
.the sequencer app was updated to talk to the sidecar during the
extend_vote
phase of consensus to gather prices to put into a vote extension.the vote extension validation logic, proposal logic, and finalization logic were also ported from connect.
Background
we want oracle data to be available to rollups (and maybe on the sequencer itself too?)
Changes
market_map
andoracle
valuesmarket_map
component for the sequenceroracle
component for the sequencer and the query service for this componentextend_vote
logic which gets the prices from the sidecar and turns them into a vote extensionverify_vote_extension
logic which performs basic validation on a vote extension during the consensus phaseprepare_proposal
logic which gathers the vote extensions from the previous block, prunes any invalid votes, and performs additional validation to create a valid set of VEsprocess_proposal
logic which validates the set of VEs proposed, checking signatures and that the voting power is >2/3 amongst other thingsfinalize_block
logic which writes the updated prices to state based on the committed vote extensions. skip uses stake-weighted median to calculate the final price, but we don't have stake-weighting yet, so i just took the median.Msg
types as sequencer actions (follow-up)SequencerBlockHeader
to contain the extended commit info + a proof for it (also follow-up)DeltaCurrencyPairStrategy
- right now only theDefaultCurrencyPairStrategy
is implemented. can also do in follow-upTesting
TODO: run this on a multi-validator network also
clone connect: https://github.com/skip-mev/connect/tree/main
install go 1.22
build and run connect:
checkout
noot/slinky
branch of astriarun sequencer app and
ASTRIA_SEQUENCER_NO_ORACLE=false
in.env
:rm -rf /tmp/astria_db rm -rf ~/.cometbft just run just run-cometbft
should see a sequencer log like:
should see a connect log like:
then, when blocks are made, should see logs like the following for each block:
Breaking Changelist
the start of the block only if vote extensions are enabled. then, there will be 3 special "txs" expected when
before there were only 2. however if vote extensions are disabled, this won't make a difference.
connect
, however as this field is optional, it is non-breaking with existing networks.connect
genesis field is set, the sequencer state will change, as the genesis state changes and new values are stored in state. however this does not affect syncing existing networks, as the genesis of the existing network can be used as-is.