Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat/engine-switch…
Browse files Browse the repository at this point in the history
…ing-committee-rotation-test
  • Loading branch information
jonastheis committed Nov 29, 2023
2 parents 75bf86a + 26441e4 commit f491489
Show file tree
Hide file tree
Showing 196 changed files with 6,575 additions and 6,219 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/docker-network-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Run Docker Network and Check Health
on:
workflow_dispatch:
pull_request:
paths-ignore:
- 'documentation/**'
- 'scripts/**'
- 'tools/**'
paths:
- '**'
- '!documentation/**'
- '!scripts/**'
- '!tools/**'
- 'tools/genesis-snapshot/**'

concurrency:
group: run-and-check-group
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/feature-network-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- uses: actions/setup-go@v4
with:
go-version-file: 'tools/genesis-snapshot/go.mod'
cache: false

- name: Print Go version
run: go version

- name: Generate genesis snapshot
working-directory: tools/genesis-snapshot
run: go run -tags=rocksdb . --config feature --seed 7R1itJx5hVuo9w9hjg5cwKFmek4HMSoBDgJZN8hKGxih --filename genesis-snapshot.bin

- name: Upload snapshot
id: upload-snapshot
run: |
SNAPSHOT_URL=$(curl -T ./tools/genesis-snapshot/genesis-snapshot.bin https://transfer.sh)
echo "Snapshot URL: $SNAPSHOT_URL"
echo "snapshot_url=$SNAPSHOT_URL" >> $GITHUB_OUTPUT
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
Expand All @@ -70,7 +89,7 @@ jobs:
- name: Ansible deploy
env:
CUSTOM_SNAPSHOT_URL: '${{ github.event.inputs.snapshotUrl }}'
DEFAULT_SNAPSHOT_URL: 'https://0x0.st/HywH.bin'
DEFAULT_SNAPSHOT_URL: '${{ steps.upload-snapshot.outputs.snapshot_url }}'
NETWORK_ENVIRONMENT: '${{ secrets.NETWORK_ENVIRONMENT }}'
IOTA_CORE_DOCKER_IMAGE_REPO: 'iotaledger/iota-core'
IOTA_CORE_DOCKER_IMAGE_TAG: 'feature'
Expand Down
39 changes: 19 additions & 20 deletions components/dashboard/explorer_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import (
"github.com/iotaledger/inx-app/pkg/httpserver"
"github.com/iotaledger/iota-core/pkg/model"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
restapipkg "github.com/iotaledger/iota-core/pkg/restapi"
"github.com/iotaledger/iota-core/pkg/retainer"
iotago "github.com/iotaledger/iota.go/v4"
"github.com/iotaledger/iota.go/v4/api"
"github.com/iotaledger/iota.go/v4/hexutil"
"github.com/iotaledger/iota.go/v4/nodeclient/apimodels"
)

// SearchResult defines the struct of the SearchResult.
Expand All @@ -27,8 +26,8 @@ type SearchResult struct {
}

func setupExplorerRoutes(routeGroup *echo.Group) {
routeGroup.GET("/block/:"+restapipkg.ParameterBlockID, func(c echo.Context) (err error) {
blockID, err := httpserver.ParseBlockIDParam(c, restapipkg.ParameterBlockID)
routeGroup.GET("/block/:"+api.ParameterBlockID, func(c echo.Context) (err error) {
blockID, err := httpserver.ParseBlockIDParam(c, api.ParameterBlockID)
if err != nil {
return ierrors.Errorf("parse block ID error: %w", err)
}
Expand All @@ -41,17 +40,13 @@ func setupExplorerRoutes(routeGroup *echo.Group) {
return c.JSON(http.StatusOK, t)
})

routeGroup.GET("/transaction/:"+restapipkg.ParameterTransactionID, getTransaction)
routeGroup.GET("/transaction/:"+api.ParameterTransactionID, getTransaction)
routeGroup.GET("/transaction/:transactionID/metadata", getTransactionMetadata)
// routeGroup.GET("/transaction/:transactionID/attachments", ledgerstateAPI.GetTransactionAttachments)
routeGroup.GET("/output/:"+restapipkg.ParameterOutputID, getOutput)
routeGroup.GET("/output/:"+api.ParameterOutputID, getOutput)
// routeGroup.GET("/output/:outputID/metadata", ledgerstateAPI.GetOutputMetadata)
// routeGroup.GET("/output/:outputID/consumers", ledgerstateAPI.GetOutputConsumers)
// routeGroup.GET("/conflict/:conflictID", ledgerstateAPI.GetConflict)
// routeGroup.GET("/conflict/:conflictID/children", ledgerstateAPI.GetConflictChildren)
// routeGroup.GET("/conflict/:conflictID/conflicts", ledgerstateAPI.GetConflictConflicts)
// routeGroup.GET("/conflict/:conflictID/voters", ledgerstateAPI.GetConflictVoters)
routeGroup.GET("/slot/commitment/:"+restapipkg.ParameterCommitmentID, getSlotDetailsByID)
routeGroup.GET("/slot/commitment/:"+api.ParameterCommitmentID, getSlotDetailsByID)

routeGroup.GET("/search/:search", func(c echo.Context) error {
search := c.Param("search")
Expand Down Expand Up @@ -172,18 +167,18 @@ func createExplorerBlock(block *model.Block, cachedBlock *blocks.Block, metadata
t.LikedInsteadChildren = lo.Map(cachedBlock.ShallowLikeChildren(), func(childBlock *blocks.Block) string {
return childBlock.ID().ToHex()
})
t.ConflictIDs = lo.Map(cachedBlock.ConflictIDs().ToSlice(), func(conflictID iotago.TransactionID) string {
return conflictID.ToHex()
t.SpendIDs = lo.Map(cachedBlock.SpenderIDs().ToSlice(), func(spendID iotago.TransactionID) string {
return spendID.ToHex()
})
} else {
switch metadata.BlockState {
case apimodels.BlockStateConfirmed, apimodels.BlockStateFinalized:
case api.BlockStateConfirmed, api.BlockStateFinalized:
t.Solid = true
t.Booked = true
t.Acceptance = true
t.Scheduled = true
t.Confirmation = true
case apimodels.BlockStateFailed, apimodels.BlockStateRejected:
case api.BlockStateFailed, api.BlockStateRejected:
t.ObjectivelyInvalid = true
}
}
Expand All @@ -192,7 +187,7 @@ func createExplorerBlock(block *model.Block, cachedBlock *blocks.Block, metadata
}

func getTransaction(c echo.Context) error {
txID, err := httpserver.ParseTransactionIDParam(c, restapipkg.ParameterTransactionID)
txID, err := httpserver.ParseTransactionIDParam(c, api.ParameterTransactionID)
if err != nil {
return err
}
Expand Down Expand Up @@ -220,7 +215,7 @@ func getTransaction(c echo.Context) error {
}

func getTransactionMetadata(c echo.Context) error {
txID, err := httpserver.ParseTransactionIDParam(c, restapipkg.ParameterTransactionID)
txID, err := httpserver.ParseTransactionIDParam(c, api.ParameterTransactionID)
if err != nil {
return err
}
Expand All @@ -233,13 +228,13 @@ func getTransactionMetadata(c echo.Context) error {
return ierrors.Errorf("tx metadata not found: %s", txID.ToHex())
}

conflicts, _ := deps.Protocol.MainEngineInstance().Ledger.ConflictDAG().ConflictingConflicts(txID)
conflicts, _ := deps.Protocol.MainEngineInstance().Ledger.SpendDAG().ConflictingSpenders(txID)

return httpserver.JSONResponse(c, http.StatusOK, NewTransactionMetadata(txMetadata, conflicts))
}

func getOutput(c echo.Context) error {
outputID, err := httpserver.ParseOutputIDParam(c, restapipkg.ParameterOutputID)
outputID, err := httpserver.ParseOutputIDParam(c, api.ParameterOutputID)
if err != nil {
return err
}
Expand All @@ -253,7 +248,7 @@ func getOutput(c echo.Context) error {
}

func getSlotDetailsByID(c echo.Context) error {
commitmentID, err := httpserver.ParseCommitmentIDParam(c, restapipkg.ParameterCommitmentID)
commitmentID, err := httpserver.ParseCommitmentIDParam(c, api.ParameterCommitmentID)
if err != nil {
return err
}
Expand All @@ -263,6 +258,10 @@ func getSlotDetailsByID(c echo.Context) error {
return err
}

if commitment.ID() != commitmentID {
return ierrors.Errorf("commitment in the store for slot %d does not match the given commitmentID (%s != %s)", commitmentID.Slot(), commitment.ID(), commitmentID)
}

diffs, err := deps.Protocol.MainEngineInstance().Ledger.SlotDiffs(commitmentID.Slot())
if err != nil {
return err
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion components/dashboard/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html> <html> <head> <meta charset="utf-8"> <title>iota-core Dashboard</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/> </head> <body> <div id="root"></div> <script type="text/javascript" src="/app/a1e7322de4eb5154c0c3.js"></script><script type="text/javascript" src="/app/vendor.146c9687b00ba21e0070.js"></script><script type="text/javascript" src="/app/app.991aa07a823b10139416.js"></script></body> </html>
<!doctype html> <html> <head> <meta charset="utf-8"> <title>iota-core Dashboard</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/> </head> <body> <div id="root"></div> <script type="text/javascript" src="/app/a1e7322de4eb5154c0c3.js"></script><script type="text/javascript" src="/app/vendor.673a0c611e9ac940cbe9.js"></script><script type="text/javascript" src="/app/app.7343ba1c945034668914.js"></script></body> </html>

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {ExplorerSearchbar} from "./ExplorerSearchbar";
import {ExplorerLiveFeed} from "./ExplorerLiveFeed";
import {ExplorerTransactionSearchbar} from "./ExplorerTransactionSearchbar";
import {ExplorerOutputSearchbar} from "./ExplorerOutputSearchbar";
import {ExplorerConflictSearchbar} from "./ExplorerConflictSearchbar";

interface Props {
nodeStore?: NodeStore;
Expand All @@ -24,7 +23,7 @@ export class Explorer extends React.Component<Props, any> {
<Row className={"mb-3"}>
<Col>
<p>
Search for addresses, blocks, transactions, outputs and conflicts.
Search for addresses, blocks, transactions, outputs and spends.
</p>
</Col>
</Row>
Expand All @@ -40,9 +39,6 @@ export class Explorer extends React.Component<Props, any> {
<Col>
<ExplorerOutputSearchbar/>
</Col>
<Col>
<ExplorerConflictSearchbar/>
</Col>
</Row>
<ExplorerLiveFeed/>
<small>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import {ExplorerStore, ExplorerOutput, OutputMetadata} from "../stores/ExplorerS
import Spinner from "react-bootstrap/Spinner";
import ListGroup from "react-bootstrap/ListGroup";
import Alert from "react-bootstrap/Alert";
import {Link} from 'react-router-dom';
import {displayManaUnit} from "../utils";
import {OutputType, outputToComponent, outputTypeToName} from "../utils/output";
import {Button, ListGroupItem} from "react-bootstrap";
import {resolveBase58ConflictID} from "../utils/conflict";

interface Props {
nodeStore?: NodeStore;
Expand Down Expand Up @@ -222,15 +220,13 @@ class OutputMeta extends React.Component<omProps, any> {
let pendingMana = this.props.pendingMana;
return (
<ListGroup>
ConflictIDs:
SpendIDs:
<ListGroup>
{
metadata.conflictIDs.map((value, index) => {
metadata.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1} className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
</Link>
<ListGroup.Item key={"SpendID" + index + 1} className="text-break">
{value}
</ListGroup.Item>
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Link } from 'react-router-dom';
import { BasicPayload } from './BasicPayload'
import { TransactionPayload } from './TransactionPayload'
import { getPayloadType, PayloadType } from '../misc/Payload'
import { resolveBase58ConflictID } from "../utils/conflict";
import { FaucetPayload } from './FaucetPayload';
import { TaggedDataPayload } from './TaggedDataPayload';

Expand Down Expand Up @@ -124,50 +123,14 @@ export class ExplorerBlockQueryResult extends React.Component<Props, any> {
Sequence Number: {blk.sequenceNumber}
</ListGroup.Item>
<ListGroup.Item>
ConflictIDs:
SpendIDs:
<ListGroup>
{
blk.conflictIDs.map((value, index) => {
blk.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1}
<ListGroup.Item key={"SpendID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
</Link>
</ListGroup.Item>
)
})
}
</ListGroup>
</ListGroup.Item>
<ListGroup.Item>
AddedConflictIDs:
<ListGroup>
{
blk.addedConflictIDs.map((value, index) => {
return (
<ListGroup.Item key={"AddedConflictID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
</Link>
</ListGroup.Item>
)
})
}
</ListGroup>
</ListGroup.Item>
<ListGroup.Item>
SubtractedConflictIDs:
<ListGroup>
{
blk.subtractedConflictIDs.map((value, index) => {
return (
<ListGroup.Item key={"SubtractedConflictID" + index + 1}
className="text-break">
<Link to={`/explorer/conflict/${value}`}>
{resolveBase58ConflictID(value)}
</Link>
{value}
</ListGroup.Item>
)
})
Expand Down

This file was deleted.

Loading

0 comments on commit f491489

Please sign in to comment.