Skip to content
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

Store txConflicting reason correctly and rename ConflictDAG to SpendDAG #508

Merged
merged 27 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3c631d2
Remove optForkAllTransactions
jkrvivian Nov 7, 2023
4063dc2
Store conflictTx failure reason on rejected txs
jkrvivian Nov 7, 2023
f5a30c4
Rename ConflictDAG to SpendDAG
jkrvivian Nov 8, 2023
9280eb4
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 8, 2023
e01553a
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 8, 2023
02fb2f7
Hook to TransactionMetadata OnRejected to capture conflicting reason …
jkrvivian Nov 8, 2023
8561076
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 9, 2023
e6dd308
Remove TestAllWithoutForkingEverything
jkrvivian Nov 9, 2023
2500e79
Remove TestAllWithoutForkingEverything
jkrvivian Nov 9, 2023
0c78f57
Rename variable spenddag to spendDAG
jkrvivian Nov 9, 2023
2857d11
Rename conflict to spend
jkrvivian Nov 9, 2023
2e2f241
Fix resource cleanup unit test to work with forking all transactions.
piotrm50 Nov 10, 2023
e6f7360
Resolve comments
jkrvivian Nov 15, 2023
5f64dfb
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 15, 2023
c81bc25
Fix unit test
jkrvivian Nov 15, 2023
f63865c
Rename ConflictSet to SpendSet
jkrvivian Nov 20, 2023
9e667b2
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 21, 2023
aa045a2
Rename conflict to spend in dashboard frontend
jkrvivian Nov 21, 2023
311b2ef
spend -> spender
cyberphysic4l Nov 21, 2023
62e675e
fix merge errors
cyberphysic4l Nov 21, 2023
316a51e
rename files
cyberphysic4l Nov 21, 2023
357a1cd
remove broken line from spendDag test and clean up
cyberphysic4l Nov 22, 2023
71709d1
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 22, 2023
bf7c619
Remove unused Spend related frontend
jkrvivian Nov 23, 2023
07d4330
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 27, 2023
bd8b14c
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 27, 2023
34d7e00
Merge branch 'develop' into fix/conflicting-tx-reason
jkrvivian Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions components/dashboard/explorer_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ func setupExplorerRoutes(routeGroup *echo.Group) {
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/:"+api.ParameterCommitmentID, getSlotDetailsByID)

routeGroup.GET("/search/:search", func(c echo.Context) error {
Expand Down Expand Up @@ -171,8 +167,8 @@ 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 {
Expand Down Expand Up @@ -232,7 +228,7 @@ 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))
}
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.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import NodeStore from "../stores/NodeStore";
import { inject, observer } from "mobx-react";
import ExplorerStore from "../stores/ExplorerStore";
import Badge from "react-bootstrap/Badge";
import {Link} from 'react-router-dom';
import {displayManaUnit} from "../utils";
import {resolveBase58ConflictID} from "../utils/conflict";
import {outputToComponent} from "../utils/output";
import {resolveConfirmationState} from "../utils/confirmation_state";

Expand Down Expand Up @@ -76,15 +74,13 @@ export class ExplorerOutputQueryResult extends React.Component<Props, any> {
{outputMetadata && <div className={"mb-2"}>
<ListGroup>
<ListGroup.Item>Transaction ID: <a href={`/explorer/transaction/${outputMetadata.outputID.transactionID}`}>{outputMetadata.outputID.transactionID}</a> </ListGroup.Item>
ConflictIDs:
SpendIDs:
<ListGroup>
{
outputMetadata.conflictIDs.map((value, index) => {
outputMetadata.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 @@ -4,7 +4,6 @@ import NodeStore from "../stores/NodeStore";
import { inject, observer } from "mobx-react";
import ExplorerStore from "../stores/ExplorerStore";
import ListGroup from "react-bootstrap/ListGroup";
// import {resolveBase58ConflictID} from "../utils/conflict";

interface Props {
nodeStore?: NodeStore;
Expand Down Expand Up @@ -40,12 +39,12 @@ export class ExplorerTransactionMetadata extends React.Component<Props, any> {
<h4>Metadata</h4>
{txMetadata && <ListGroup>
<ListGroup.Item>
ConflictIDs:
SpendIDs:
<ListGroup>
{
txMetadata.conflictIDs && txMetadata.conflictIDs.map((value, index) => {
txMetadata.spendIDs && txMetadata.spendIDs.map((value, index) => {
return (
<ListGroup.Item key={"ConflictID" + index + 1} className="text-break">
<ListGroup.Item key={"SpendID" + index + 1} className="text-break">
<a href={`/explorer/transaction/${value}`}>{value}</a>
</ListGroup.Item>
)
Expand Down
Loading
Loading